Skip to content

Commit

Permalink
Added support for pypi.
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Littman committed Sep 1, 2015
1 parent c8b74aa commit 3019b76
Show file tree
Hide file tree
Showing 19 changed files with 69 additions and 28 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Tool for retrieving data from the ORCID API and crosswalking to VIVO-ISF.

Try it at http://gw-orcid2vivo.wrlc.org/orcid2vivo

##Installation
With python/pip installed:

```
pip install orcid2vivo
```

## Commandline
* Supports outputting to:
* screen / stdout
Expand Down
18 changes: 10 additions & 8 deletions orcid2vivo.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#!/usr/bin/env python

import requests
import argparse
import codecs
from rdflib import Literal, Graph, URIRef
from rdflib.namespace import Namespace
from app.vivo_uri import HashIdentifierStrategy
from app.vivo_namespace import VIVO, FOAF
from app.affiliations import AffiliationsCrosswalk
from app.bio import BioCrosswalk
from app.fundings import FundingCrosswalk
from app.works import WorksCrosswalk
from app.utility import sparql_insert, clean_orcid
import app.vivo_namespace as ns
from orcid2vivo_app.vivo_uri import HashIdentifierStrategy
from orcid2vivo_app.vivo_namespace import VIVO, FOAF
from orcid2vivo_app.affiliations import AffiliationsCrosswalk
from orcid2vivo_app.bio import BioCrosswalk
from orcid2vivo_app.fundings import FundingCrosswalk
from orcid2vivo_app.works import WorksCrosswalk
from orcid2vivo_app.utility import sparql_insert, clean_orcid
import orcid2vivo_app.vivo_namespace as ns


class SimpleCreateEntitiesStrategy():
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion app/affiliations.py → orcid2vivo_app/affiliations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from vivo_namespace import FOAF
from vivo_uri import to_hash_identifier
from utility import add_date, add_date_interval
import app.vivo_namespace as ns
import orcid2vivo_app.vivo_namespace as ns


class AffiliationsCrosswalk():
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions orcid2vivo_loader.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

import argparse
import sqlite3
import os
Expand All @@ -7,8 +9,8 @@
from rdflib import Graph
from rdflib.compare import graph_diff
from orcid2vivo import default_execute
from app.vivo_namespace import ns_manager
from app.utility import sparql_insert, sparql_delete
from orcid2vivo_app.vivo_namespace import ns_manager
from orcid2vivo_app.utility import sparql_insert, sparql_delete

log = logging.getLogger(__name__)

Expand Down
4 changes: 3 additions & 1 deletion orcid2vivo_service.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/env python

from flask import Flask, render_template, request, session, Response, flash, Markup
import argparse
import json
import urllib
from orcid2vivo import default_execute
import app.utility as utility
import orcid2vivo_app.utility as utility

app = Flask(__name__)
def_format = None
Expand Down
28 changes: 28 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from setuptools import setup

setup(
name='orcid2vivo',
version='0.9.0',
url='https://github.com/gwu-libraries/orcid2vivo',
author='Justin Littman',
author_email='[email protected]',
py_modules=['orcid2vivo', 'orcid2vivo_loader', 'orcid2vivo_service'],
packages=['orcid2vivo_app', ],
scripts=['orcid2vivo.py', 'orcid2vivo_loader.py', 'orcid2vivo_service.py'],
description="For retrieving data from the ORCID API and crosswalking to VIVO-ISF.",
platforms=['POSIX'],
test_suite='tests',
install_requires=['rdflib>=4.2.0',
'requests>=2.7.0',
'bibtexparser>=0.6.1',
'flask>=0.10.1'],
tests_require=['vcrpy>=1.7.0',
'mock>=1.3.0'],
classifiers=[
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modules',
'Programming Language :: Python :: 2.7',
'Development Status :: 4 - Beta',
'Framework :: Flask',
],
)
6 changes: 3 additions & 3 deletions tests/app/test_affiliations.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from unittest import TestCase
import json
from app.affiliations import AffiliationsCrosswalk
import app.vivo_namespace as ns
from orcid2vivo_app.affiliations import AffiliationsCrosswalk
import orcid2vivo_app.vivo_namespace as ns
from rdflib import Graph
from app.vivo_uri import HashIdentifierStrategy
from orcid2vivo_app.vivo_uri import HashIdentifierStrategy
from orcid2vivo import SimpleCreateEntitiesStrategy


Expand Down
8 changes: 4 additions & 4 deletions tests/app/test_bio.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

from unittest import TestCase
import json
from app.bio import BioCrosswalk
import app.vivo_namespace as ns
from orcid2vivo_app.bio import BioCrosswalk
import orcid2vivo_app.vivo_namespace as ns
from rdflib import Literal, Graph, RDF, RDFS
from app.vivo_namespace import D, VIVO, FOAF
from app.vivo_uri import HashIdentifierStrategy
from orcid2vivo_app.vivo_namespace import D, VIVO, FOAF
from orcid2vivo_app.vivo_uri import HashIdentifierStrategy
from orcid2vivo import SimpleCreateEntitiesStrategy


Expand Down
6 changes: 3 additions & 3 deletions tests/app/test_fundings.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from unittest import TestCase
from tests import FIXTURE_PATH
from app.fundings import FundingCrosswalk
from orcid2vivo_app.fundings import FundingCrosswalk
import orcid2vivo
import app.vivo_namespace as ns
from app.vivo_uri import HashIdentifierStrategy
import orcid2vivo_app.vivo_namespace as ns
from orcid2vivo_app.vivo_uri import HashIdentifierStrategy
from orcid2vivo import SimpleCreateEntitiesStrategy

from rdflib import Graph, RDFS
Expand Down
2 changes: 1 addition & 1 deletion tests/app/test_utility.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from unittest import TestCase
from app.utility import clean_orcid
from orcid2vivo_app.utility import clean_orcid


class TestUtility(TestCase):
Expand Down
4 changes: 2 additions & 2 deletions tests/app/test_vivo_uri.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest import TestCase
from app.vivo_uri import HashIdentifierStrategy
from app.vivo_namespace import VIVO, OBO
from orcid2vivo_app.vivo_uri import HashIdentifierStrategy
from orcid2vivo_app.vivo_namespace import VIVO, OBO


class TestHashIdentifierStrategy(TestCase):
Expand Down
6 changes: 3 additions & 3 deletions tests/app/test_works.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

from unittest import TestCase
import json
from app.works import WorksCrosswalk
import app.vivo_namespace as ns
from orcid2vivo_app.works import WorksCrosswalk
import orcid2vivo_app.vivo_namespace as ns
from rdflib import Graph, Literal, RDFS
from app.vivo_uri import HashIdentifierStrategy
from orcid2vivo_app.vivo_uri import HashIdentifierStrategy
from orcid2vivo import SimpleCreateEntitiesStrategy

#Saving this because will be monkey patching
Expand Down

0 comments on commit 3019b76

Please sign in to comment.