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:
- transifex-open-api.herokuapp.com/ (instant deployment)
- transifex.quelltext.eu (daily deployment)
You can deploy the app using Heroku. There is a free plan.
You can enable automatic deployments when the repository is updated in the Deploy Section of the app management.
Need to be set:
TRANSIFEX_PASSWORD
Is the API token from the user settings. This is required to access the API.TRANSIFEX_USERNAME
defaults tosecret-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 isopen_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 tohttps://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 tohttp://localhost:8080
and install shields.io.APP_HAS_HTTPS
defaults tofalse
If your app is behind HTTPS, you can enable this. Note that shields.io requires HTTPS for badges.PORT
defaults to5000
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.
Install Python3 and Pip.
pip install -r requirements.txt
Set environment variables.
export TRANSIFEX_PASSWORD=...
export TRANSIFEX_USERNAME=...
Start the app.
python3 app.py
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