(DEPRECATED) A Python library for working with a Data Package Registry.
Project description
**This project is **DEPRECATED**. You should use
<https://github.com/datapackages/datapackage-py> instead. This repository is
just for historical purposes.**
datapackage-registry-py
=======================
A Python library for working with a Data Package Registry.
It comes with a cached version of the registry and schemas from
<https://github.com/dataprotocols/schemas>.
Usage
-----
```python
import datapackage_registry
# get the default registry objects
registry = datapackage_registry.Registry()
# see the available profiles in the registry
print(registry.available_profiles)
# {
# 'base': {
# 'id': 'base',
# 'schema': 'https://rawgit.com/dataprotocols/schemas/master/data-package.json',
# 'specification': 'http://dataprotocols.org/data-packages',
# 'title': 'Data Package'
# },
# 'tabular': {
# 'id': 'tabular',
# 'schema': 'https://rawgit.com/dataprotocols/schemas/master/tabular-data-package.json',
# 'specification': 'http://dataprotocols.org/tabular-data-package/',
# 'title': 'Tabular Data Package'
# }
# }
# get a profile by its id
base_profile = registry.get('base')
```
If you’d like to use a custom registry, you can pass its URL or local
path to the `Registry()` constructor, as in:
```python
import datapackage_registry
registry = datapackage_registry.Registry('http://someplace.com/my-registry.csv')
```
If you’d like to get a schema that's not in the registry, you can pass its URL
or local path to `Registry().get_external()` method, as in:
```python
import datapackage_registry
registry = datapackage_registry.Registry()
try:
schema = registry.get_external('http://someplace.com/schema.json')
except datapackage_registry.exceptions.DataPackageRegistryException:
pass # handle error
```
Developer notes
---------------
These notes are intended to help people that want to contribute to this
package itself. If you just want to use it, you can safely ignore this.
### Updating the local schemas cache
We cache the schemas from <https://github.com/dataprotocols/schemas>
using git-subtree. To update it, use:
git subtree pull --prefix datapackage_registry/schemas https://github.com/dataprotocols/schemas.git master --squash
<https://github.com/datapackages/datapackage-py> instead. This repository is
just for historical purposes.**
datapackage-registry-py
=======================
A Python library for working with a Data Package Registry.
It comes with a cached version of the registry and schemas from
<https://github.com/dataprotocols/schemas>.
Usage
-----
```python
import datapackage_registry
# get the default registry objects
registry = datapackage_registry.Registry()
# see the available profiles in the registry
print(registry.available_profiles)
# {
# 'base': {
# 'id': 'base',
# 'schema': 'https://rawgit.com/dataprotocols/schemas/master/data-package.json',
# 'specification': 'http://dataprotocols.org/data-packages',
# 'title': 'Data Package'
# },
# 'tabular': {
# 'id': 'tabular',
# 'schema': 'https://rawgit.com/dataprotocols/schemas/master/tabular-data-package.json',
# 'specification': 'http://dataprotocols.org/tabular-data-package/',
# 'title': 'Tabular Data Package'
# }
# }
# get a profile by its id
base_profile = registry.get('base')
```
If you’d like to use a custom registry, you can pass its URL or local
path to the `Registry()` constructor, as in:
```python
import datapackage_registry
registry = datapackage_registry.Registry('http://someplace.com/my-registry.csv')
```
If you’d like to get a schema that's not in the registry, you can pass its URL
or local path to `Registry().get_external()` method, as in:
```python
import datapackage_registry
registry = datapackage_registry.Registry()
try:
schema = registry.get_external('http://someplace.com/schema.json')
except datapackage_registry.exceptions.DataPackageRegistryException:
pass # handle error
```
Developer notes
---------------
These notes are intended to help people that want to contribute to this
package itself. If you just want to use it, you can safely ignore this.
### Updating the local schemas cache
We cache the schemas from <https://github.com/dataprotocols/schemas>
using git-subtree. To update it, use:
git subtree pull --prefix datapackage_registry/schemas https://github.com/dataprotocols/schemas.git master --squash
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file datapackage-registry-0.5.0.tar.gz
.
File metadata
- Download URL: datapackage-registry-0.5.0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66abf635975f1f9ff45f9e557cb6f368c2bcbd9454f1a2630966937906dc1e42 |
|
MD5 | 3d923610f2140d3cc8161b92f395e02f |
|
BLAKE2b-256 | 3152ec6c9ac3f0c8261aeb85f6ceb76e3898c47eb8fe8652a20fdac79d6cb3c6 |