Skip to content
/ SP-286 Public template

PyPI template inspired by the Nasa SP-286 Apollo report.

Notifications You must be signed in to change notification settings

chloelavrat/SP-286

Repository files navigation

Banner

APOLLO_LIBRARY is a template PyPI package designed to provide all the necessary components for creating your own package. Follow the instructions below to utilize it effectively in your projects. Note that this package is a placeholder, featuring only three modules that manage sample timestamps.

Table of Contents

Installation

This template includes several essential shell scripts in the scripts directory to streamline the management and development of the library. Ensure Python is installed on your computer before proceeding.

Steps to Use the Template:

  1. Change the Library Name:

    python ./scripts/rename_package.py --old APOLLO_LIBRARY --new YourNewLibraryName

    Example:

    python ./scripts/rename_package.py --old APOLLO_LIBRARY --new Artemis_program
  2. Change the Library Version:

    ./scripts/change_version.sh X.Y.Z

    For detailed versioning information, refer to the Versioning section below.

  3. Create and Activate a Virtual Environment:

    ./scripts/virtualenv_create.sh
    source ./scripts/virtualenv_activate.sh
  4. Develop Your Library:

    Place your code in the APOLLO_LIBRARY/ directory. Ensure that __init__.py files are present in each directory and subdirectory of the library.

  5. Document Your Code:

    Use the Google docstring format for all functions, classes, and files to ensure consistent and comprehensive documentation.

  6. Generate the Documentation:

    ./scripts/generate_doc.sh

    Documentation will be available in the /docs/API/ directory.

Usage

To utilize the placeholder functionality, you can import the provided modules and use them as follows:

from APOLLO_LIBRARY.time.converter import unix_to_iso, iso_to_datetime

# Convert UNIX timestamp to ISO 8601 format
timestamp = 1626797436
iso_time = unix_to_iso(timestamp)
print(iso_time)  # Output: '2021-07-20T12:50:36'

# Convert ISO 8601 format to Python datetime object
iso_time = '2021-07-20T12:50:36'
datetime_obj = iso_to_datetime(iso_time)
print(datetime_obj)  # Output: datetime.datetime(2021, 7, 20, 12, 50, 36)

Versioning

We follow Semantic Versioning (SemVer) for version numbering vX.Y.Z:

  • X: Major version (backward-incompatible changes)
  • Y: Minor version (backward-compatible new features)
  • Z: Patch version (backward-compatible bug fixes)

When creating a new release:

  1. Make necessary changes and improvements.
  2. Update the version number in setup.py.
  3. Commit your changes and push them to the repository.
  4. Add a tag to the commit for the new version:
    git tag vX.Y.Z
    git push origin vX.Y.Z

This will trigger the CI process to build and publish the package on PyPI.

Placeholder Functionality

The APOLLO_LIBRARY template includes utility functions for handling time-related tasks, such as time conversion, calculations, and formatting. The time_converter module enables conversions between various time formats, including UNIX timestamps, ISO 8601, and Python datetime objects.

Acknowledgements

Special thanks to the Apollo team for their insightful guide on efficient production methods. Their comprehensive approach and innovative solutions significantly enhance productivity and operational efficiency. If you are curious, the report is available here.

About

PyPI template inspired by the Nasa SP-286 Apollo report.

Resources

Stars

Watchers

Forks