An API to store final dates and return various parameters related to these dates.
- Create, update, retrieve, and delete date objects.
- Calculate time differences and provide detailed time unit breakdowns.
- Validate and handle timezones using
tzdata. - RESTful API built with Flask-RESTx.
- MongoDB integration for data persistence.
-
Clone the repository:
git clone https://github.com/gabrielsrs/dateEnd.git cd dateEnd -
Create a virtual environment and activate it:
python -m venv venv
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables: Create a .env file in the root directory and add the following:
MONGO_CONNECTION=<your_mongo_connection_string> -
Run the application:
python app.py
-
The API provides the following endpoints:
POST /date: Create a new date.GET /date/<date_id>: Retrieve a date by ID.PATCH /date/<date_id>: Update an existing date.DELETE /date/<date_id>: Delete a date.GET /timezones: Retrieve all available timezones.
-
Use tools like Postman or cURL to interact with the API.
To run the test suite, execute the following command:
pytestContributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add feature-name" - Push to the branch:
git push origin feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.