-
Notifications
You must be signed in to change notification settings - Fork 607
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/filtering
- Loading branch information
Showing
9 changed files
with
157 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Credit | ||
For everyone who has contributed in big and in small ways, **thank you!**. | ||
|
||
## Contributors | ||
This is a list of active contributors. Feel free to @ message them in issues and converse with them directly. | ||
|
||
- [Darkborderman](https://github.com/Darkborderman) | ||
- [sparkingdark](https://github.com/sparkingdark) | ||
- [sanggusti](https://github.com/sanggusti) | ||
- [haiyangdeperci](https://github.com/haiyangdeperci) | ||
- [sohamsshah](https://github.com/sohamsshah) | ||
- [YuvalOfer](https://github.com/YuvalOfer) | ||
|
||
## Data Maintainers | ||
Help us make Hub the largest repository of unstructured datasets! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# JUST TO GET COVERAGE | ||
from hub.url import UrlProtocol, UrlType, Url | ||
|
||
|
||
def test_url(): | ||
Url.parse("Some url") | ||
Url( | ||
UrlType.LOCAL, | ||
UrlProtocol.FILESYSTEM, | ||
"some path", | ||
"some bucket", | ||
"some user", | ||
"some dataset", | ||
"some endpoint", | ||
).url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# NOT IMPLEMENTED COMPLETELY YET! | ||
|
||
from typing import Union | ||
from enum import Enum | ||
|
||
from hub.defaults import AZURE_HOST_SUFFIX | ||
|
||
|
||
class UrlProtocol(Enum): | ||
UNKNOWN = "unknown" | ||
S3 = "s3" | ||
GCS = "gcs" | ||
AZURE = "azure" | ||
FILESYSTEM = "filesystem" | ||
|
||
|
||
class UrlType(Enum): | ||
HUB = "hub" | ||
LOCAL = "local" | ||
CLOUD = "cloud" | ||
|
||
|
||
class Url: | ||
@classmethod | ||
def parse(cls, url: str) -> "Url": | ||
assert isinstance(url, str) | ||
|
||
pass | ||
|
||
def __init__( | ||
self, | ||
url_type: UrlType, | ||
protocol: UrlProtocol, | ||
path: str, # for get_mapper(path) | ||
bucket: Union[str, None] = None, | ||
user: Union[str, None] = None, | ||
dataset: Union[str, None] = None, | ||
endpoint_url: Union[str, None] = None, | ||
): | ||
assert isinstance(url_type, UrlType) | ||
assert isinstance(protocol, UrlProtocol) | ||
assert isinstance(path, str) | ||
assert isinstance(bucket, str) or bucket is None | ||
assert isinstance(user, str) or user is None | ||
assert isinstance(dataset, str) or dataset is None | ||
assert isinstance(endpoint_url, str) or endpoint_url is None | ||
|
||
self.url_type = url_type | ||
self.protocol = protocol | ||
self.path = path | ||
self.bucket = bucket | ||
self.user = user | ||
self.dataset = dataset | ||
self.endpoint_url = endpoint_url | ||
|
||
@property | ||
def url(self) -> str: | ||
pass |