https://github.com/acdh-oeaw/apimapper
Science Score: 10.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 3 committers (33.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (5.2%) to scientific vocabulary
Keywords
Repository
Basic Info
- Host: GitHub
- Owner: acdh-oeaw
- License: mit
- Language: Python
- Default Branch: master
- Size: 39.1 KB
Statistics
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 2
- Releases: 0
Topics
Metadata Files
README.md
API Wrapper
Install package
- from PyPi: pip install apimapper
- from source: pip install -e .
Unit Testing
pytest
Usage
- See https://github.com/acdh-oeaw/apimapper/blob/develop/demo/APIMapper%20Demo.ipynb
- Multiple APIs (GND and VIAF) mapped to a common JSON schema
VIAF only returns VIAF ID - which is contructed into a url using a "rule" ``` from apimapper import APIMapper from apimapper import config
GNDPERSONMAP = {config.DIRECT: {'uri': 'id', 'label': 'label'}}
VIAFPERSONMAP = {config.RESULT: 'result', config.FILTER: {'nametype': 'personal'}, config.DIRECT: {'label': 'displayForm'}, config.RULES: {'uri': {config.RULE: '"http://www.viaf.org/viaf/{p1}"', config.FIELDS: {'p1': 'viafid'}}}}
GNDPERSONSOURCE = {config.URL: 'https://lobid.org/gnd/search', config.QUERY_FIELD: 'q', config.PAYLOAD: {'format':'json:suggest', 'filter': 'type:Person'}}
VIAFPERSONSOURCE = {config.URL: 'http://www.viaf.org/viaf/AutoSuggest', config.QUERY_FIELD: 'query'}
gnd = APIMapper(GNDPERSONSOURCE, GNDPERSONMAP) viaf = APIMapper(VIAFPERSONSOURCE, VIAFPERSONMAP) apis = [gnd, viaf] results = [] for api in apis: res = api.fetch_results('Pratchett') results.extend(res)
print(results) ```
- Using mapping rules
Splitting the GND label field into meaningful subparts ``` from apimapper import APIMapper from apimapper import config
GNDPERSONSOURCE = {config.URL: 'https://lobid.org/gnd/search', config.QUERY_FIELD: 'q', config.PAYLOAD: {'format':'json:suggest', 'filter': 'type:Person'}}
GNDPERSONMAP = {config.DIRECT: {'label': 'label', 'uri': 'id'}, config.RULES: {'source': {config.RULE: '"GND"'}, 'labelname': {config.RULE: '"{p1}".split("|")[0].strip()', config.FIELDS: {'p1': 'label'}}, 'labelyear': {config.RULE: '"{p1}".split("|")[1].strip() if "{p1}".split("|")[1].strip()[0].isnumeric() else ""', config.FIELDS: {'p1': 'label'}}, 'label_profession': {config.RULE: '"{p1}".split("|")[2].strip() if "{p1}".split("|")[1].strip()[0].isnumeric() else "{p1}".split("|")[1].strip()', config.FIELDS: {'p1': 'label'}}}}
api = APIMapper(GNDPERSONSOURCE, GNDPERSONMAP) res = api.fetch_results('Rosalind Franklin') ```
- More example usage in apimapper/demo
Owner
- Name: Austrian Centre for Digital Humanities & Cultural Heritage
- Login: acdh-oeaw
- Kind: organization
- Email: acdh@oeaw.ac.at
- Location: Vienna, Austria
- Website: https://www.oeaw.ac.at/acdh
- Repositories: 476
- Profile: https://github.com/acdh-oeaw
GitHub Events
Total
Last Year
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 27
- Total Committers: 3
- Avg Commits per committer: 9.0
- Development Distribution Score (DDS): 0.148
Top Committers
| Name | Commits | |
|---|---|---|
| Saranya Balasubramanian | S****n@o****t | 23 |
| Gytha Ogg | g****g@u****m | 2 |
| gythaogg | g****t@g****m | 2 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 0
- Total pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 2
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- dependabot[bot] (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 195 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 14
- Total maintainers: 1
pypi.org: apimapper
API Mapper
- Homepage: https://github.com/acdh-oeaw/apimapper
- Documentation: https://apimapper.readthedocs.io/
- License: MIT
-
Latest release: 0.7.9
published almost 3 years ago
Rankings
Maintainers (1)
Dependencies
- Markdown ==3.0.1
- atomicwrites ==1.2.1
- attrs ==18.2.0
- certifi ==2019.3.9
- chardet ==3.0.4
- idna ==2.8
- more-itertools ==5.0.0
- pluggy ==0.8.1
- py ==1.7.0
- pytest ==4.1.0
- requests ==2.21.0
- requests-futures ==0.9.9
- six ==1.12.0
- urllib3 >=1.24.2
- markdown *
- requests *