GithubHelp home page GithubHelp logo

wayoffthecoast / api-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from teselagen/api-client

0.0 0.0 0.0 1.04 MB

Teselagen api client

Dockerfile 0.91% Shell 1.74% Python 41.23% Jupyter Notebook 56.13%

api-client's Introduction

TeselaGen Python API Client.

The TeselaGen Python API Client runs on Python 3.

NOTE : All the following commands are supposed to be run on the base directory, unless specified.

Library Installation

This library contains the TeselaGen Python API Client.

To install it locally,

  1. Install it with pip

    pip3 install teselagen
    

Examples

To be able to run the examples, you need to (after installing the library)

  1. Clone or download lib/examples

  2. Open any notebook in the examples folder with Jupyter Notebook

Use the provided environment

You can use the provided docker environment that contains a ready to use installation of all required packages to run the notebooks. Here are the instructions according to your OS

Linux/MacOS

  1. After clone/download, go to docker_environment and run the build script with sh build.sh

  2. Run the container with sh run.sh

  3. Open your browser and set the address: http://localhost:8888. From there you can explore all example notebooks

Development (Linux/MacOS)

Docker environment

  1. Build the docker environment with command sh build.sh

  2. Run the container as a developer with the command sh run_dev.sh. With this command the teselagen library will be installed in editable mode.

Dependencies

Install dependencies

If lock file exists (the lock file contains fixed versions of dependencies), the poetry install command will install all dependencies according to the lock file (lock file must be added to the repo). If the file doens't exist it will generate the lock file again.

Update dependencies

Use this command if you made changes on the dependencies at the toml file:

poetry update

It is the equivalent to make an install after deleting the lock file.

Tests

  1. Add your credentials

    To run the tests, you must create a .credentials file containing the test username and password, in the root folder (teselagenpy/lib).

    The content of .credentials file should look similar to the following:

        {
            "username" : "ReplaceWithYourUsername",
            "password" : "ReplaceWithYourPassword"
        }
    
    - DO NOT COMMIT THIS FILE : .credentials
  2. Modify configuration

    You may modify some test configuration parameters by creating a .test_configuration file. This is a json formatted file, where you can edit the server name used for tests. This file must be stored next to .credentials file. Here is an example

    {
        "host_url" : "https://platform.teselagen.com"
    }
    
  3. Run the tests (on /lib folder)

    python3 setup.py test
    

    You may use the docker environment for testing. For that, first build the environment with sh build.sh at the docker_environment folder. Then just run the container with sh run_dev.sh. Once inside (docker exec -ti tgclient bash), go to home/development/lib and you are ready to run the test command shown above.

Publishing

Publishing is limited to administrators. PyPi publishing is made by using poetry.

To publish:

  1. Run poetry build from the project's root folder (same directory as pyproject.toml)

  2. Be sure you have set the credentials with the api token:

poetry config pypi-token.pypi <TOKEN>

Ask for a token to administrators if needed

  1. Publish (check you have set a new version tag in pyproject.toml):
poetry publish

api-client's People

Contributors

andrespereztesela avatar ccwilson avatar diegovalenzuelaiturra avatar juanneilson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.