Skip to content

niccokunzmann/open-transifex-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Transifex API

This project aims at making it easy for people to share their open projects on Transifex with an open API to services on the Internet.

It includes:

  • Open Endpoints of the Transifex API
  • Example usage of the Transifex API by [shields.io] through dynamic badges
  • Badge endpoints for projects

To open your API, you need to invite the account to your project which runs the endpoint.

If you run an endpoint, you can list it here:

Deployment

You can deploy the app using Heroku. There is a free plan.

Deploy

You can enable automatic deployments when the repository is updated in the Deploy Section of the app management.

Heroku Button Documentation

Configuration

Need to be set:

  • TRANSIFEX_PASSWORD
    Is the API token from the user settings. This is required to access the API.
  • TRANSIFEX_USERNAME defaults to secret-user
    Is the user of the API token. This is required so that the displayed documentation allows people to invite the user to their project so the project can publish its API. E.g. the user of here is open_api.

Optional:

  • APP_CACHE_TIMEOUT defaults to 1 day
    The time in seconds the response should be cached, so we do not use up the quota of the transifex user.
  • SHIELDS_API defaults to https://img.shields.io
    This is the endpoint used to generate badges. If you want to test your badges as a developer, you can set this to http://localhost:8080 and install shields.io.
  • APP_HAS_HTTPS defaults to false
    If your app is behind HTTPS, you can enable this. Note that shields.io requires HTTPS for badges.
  • PORT defaults to 5000
    Is the port the app uses. This is required by Heroku.

All configuration must be duplicated to app.json in order for Heroku to correctly display the values.

Development

Install Python3 and Pip.

pip install -r requirements.txt

Set environment variables.

export TRANSIFEX_PASSWORD=...
export TRANSIFEX_USERNAME=...

Start the app.

python3 app.py

Docker

Use the image:

docker run --rm                                \
           -p 5000:5000                        \
           -e "TRANSIFEX_PASSWORD=..."         \
           -e "TRANSIFEX_USER=..."             \
           niccokunzmann/open-transifex-api

Build the image:

docker build . -t niccokunzmann/open-transifex-api

Related Work

About

Open the transifex API of your project to other people

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published