Skip to content

IGSN/igsn-namespace-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

About The Project

A simple registry information service that provides information about IGSN allocating agents and namespaces through a simple API.

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

  • python 3.8 and pip - I'll not go into how to get Python (see here or here) and pip should come for free with your install.
  • pipenv - we use this to manage dependencies. You can install it using pip by doing
$ pip install pipenv

Installation

  1. Clone the repo
$ git clone https://github.com/jesserobertson/igsn_namespace_service.git

Cloning into 'igsn_namespace_service'...
# snp output
  1. Install Python packages
$ cd igsn_namespace_service
$ pipenv install

[====] Creating virtual environment...
# snip output
Installing dependencies from Pipfile.lock (e902b8)…
  ================================ 46/46 - 00:00:19
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
  1. To run the test suite or do development, include the --dev dependencies:
$ pipenv install --dev

# output as above, should include dev dependencies like pytest

$ pipenv run python -m pytest

========================== test session starts ===========================
# snip test output
Success: no issues found in 6 source files
========================== 39 passed in 10.36s ===========================

Usage

The service is very basic and can run standalone. To run a local version of the service, you just need to stand up a test server and start making requests:

  1. Run the test server using uvicorn (or similar ASGI webservice). This should start a service listening on whatever port you bind it to
$ pipenv run uvicorn app:app --port 8080

INFO:     Started server process [21152]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
  1. Now you should be able to start making requsts using whatever client takes your fancy. I quite like httpie, so I'd do
$ http :8080/agents/CSIRO

HTTP/1.1 200 OK
content-length: 459
content-type: application/json
date: Sun, 12 Apr 2020 05:29:34 GMT
server: uvicorn

{
    "name": "CSIRO",
    "namespaces": [
        {
            "date_created": "2013-05-24T15:07:34+02:00",
            "handle_prefix": "10273/ARRC",
            "namespace": "ARRC",
            "owner": "CSIRO"
        },
        {
            "date_created": "2015-01-22T13:01:15+01:00",
            "handle_prefix": "10273/CS",
            "namespace": "CS",
            "owner": "CSIRO"
        },
        {
            "date_created": "2014-05-19T08:44:04+02:00",
            "handle_prefix": "10273/CSD",
            "namespace": "CSD",
            "owner": "CSIRO"
        },
        {
            "date_created": "2013-05-24T15:06:59+02:00",
            "handle_prefix": "10273/CSI",
            "namespace": "CSI",
            "owner": "CSIRO"
        }
    ]
}
  1. To see the Swagger documentation, head to https://localhost:8080/docs.

For more examples, please refer to the Documentation

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Your Name - @jessrobertson

Project Link: https://github.com/jesserobertson/igsn_namespace_service

Acknowledgements

About

Simple API to query governed namespaces

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages