Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/apollo-roboto/apolloroboto.constants

Utility library containing a collection of constants
https://github.com/apollo-roboto/apolloroboto.constants

constants csharp generated-code math mathematics numbers python space

Last synced: about 1 month ago
JSON representation

Utility library containing a collection of constants

Awesome Lists containing this project

README

        

# ApolloRoboto.Constants

This is a utility library containing a collection of constant numbers making them easy to access and
explore. This repository aims at generating source codes to multiple languages and publish them.

It's a learning project, my main motivation was to explore the chalenges of code generation and
publishing them to multiple code repotitory.

## Currently Supported Language:
- C# - [Nuget](https://www.nuget.org/packages/ApolloRoboto.Constants)
- Python - [PyPI](https://pypi.org/project/arconstants/)

## C# Example Usage:
```c#
using System;
using static ApolloRoboto.Constants.Math;

public class Program
{
public void Main(string[] args)
{
Console.WriteLine(PI * GOLDEN_RATIO)
}
}
```

## Python example usage:
```python
from ARConstants.Math import *

print(PI * GOLDEN_RATIO)
```

## Contributing

Workflows are configured to regenerate and publish code at each changes.

All constant numbers are declared in the `constants.yaml` file.

To generate the code locally, use the `generate.py` script
```bash
python ./generate.py
```

If you make a pull request, please increment the version number in `meta.yaml` by `0.0.1`