# -*- coding: utf-8 -*-
from setuptools import setup

package_dir = \
{'': 'src'}

packages = \
['fpm_universe']

package_data = \
{'': ['*']}

install_requires = \
['jq>=1.3.0,<2.0.0',
 'pandas>=1.3.5,<1.4.0',
 'pyarrow>=10.0.1,<11.0.0',
 'pyyaml>=6.0,<7.0']

extras_require = \
{'docs': ['Sphinx>=5.0,<6.0',
          'insipid-sphinx-theme>=0.3.6,<0.4.0',
          'myst-parser>=0.18,<0.19']}

entry_points = \
{'console_scripts': ['factor-pricing-model-universe = fpm_universe.cli:main']}

setup_kwargs = {
    'name': 'factor-pricing-model-universe',
    'version': '2022.2.0',
    'description': 'Package to build universes for factor pricing model',
    'long_description': '# Factor Pricing Model Universe\n\n<p align="center">\n  <a href="https://github.com/factorpricingmodel/factor-pricing-model-universe/actions?query=workflow%3ACI">\n    <img src="https://img.shields.io/github/workflow/status/factorpricingmodel/factor-pricing-model-universe/CI/main?label=CI&logo=github&style=flat-square" alt="CI Status" >\n  </a>\n  <a href="https://factor-pricing-model-universe.readthedocs.io">\n    <img src="https://img.shields.io/readthedocs/factor-pricing-model-universe.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">\n  </a>\n  <a href="https://codecov.io/gh/factorpricingmodel/factor-pricing-model-universe">\n    <img src="https://img.shields.io/codecov/c/github/factorpricingmodel/factor-pricing-model-universe.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">\n  </a>\n</p>\n<p align="center">\n  <a href="https://python-poetry.org/">\n    <img src="https://img.shields.io/badge/packaging-poetry-299bd7?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJJSURBVHgBfZLPa1NBEMe/s7tNXoxW1KJQKaUHkXhQvHgW6UHQQ09CBS/6V3hKc/AP8CqCrUcpmop3Cx48eDB4yEECjVQrlZb80CRN8t6OM/teagVxYZi38+Yz853dJbzoMV3MM8cJUcLMSUKIE8AzQ2PieZzFxEJOHMOgMQQ+dUgSAckNXhapU/NMhDSWLs1B24A8sO1xrN4NECkcAC9ASkiIJc6k5TRiUDPhnyMMdhKc+Zx19l6SgyeW76BEONY9exVQMzKExGKwwPsCzza7KGSSWRWEQhyEaDXp6ZHEr416ygbiKYOd7TEWvvcQIeusHYMJGhTwF9y7sGnSwaWyFAiyoxzqW0PM/RjghPxF2pWReAowTEXnDh0xgcLs8l2YQmOrj3N7ByiqEoH0cARs4u78WgAVkoEDIDoOi3AkcLOHU60RIg5wC4ZuTC7FaHKQm8Hq1fQuSOBvX/sodmNJSB5geaF5CPIkUeecdMxieoRO5jz9bheL6/tXjrwCyX/UYBUcjCaWHljx1xiX6z9xEjkYAzbGVnB8pvLmyXm9ep+W8CmsSHQQY77Zx1zboxAV0w7ybMhQmfqdmmw3nEp1I0Z+FGO6M8LZdoyZnuzzBdjISicKRnpxzI9fPb+0oYXsNdyi+d3h9bm9MWYHFtPeIZfLwzmFDKy1ai3p+PDls1Llz4yyFpferxjnyjJDSEy9CaCx5m2cJPerq6Xm34eTrZt3PqxYO1XOwDYZrFlH1fWnpU38Y9HRze3lj0vOujZcXKuuXm3jP+s3KbZVra7y2EAAAAAASUVORK5CYII=" alt="Poetry">\n  </a>\n  <a href="https://github.com/ambv/black">\n    <img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square" alt="black">\n  </a>\n  <a href="https://github.com/pre-commit/pre-commit">\n    <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">\n  </a>\n</p>\n<p align="center">\n  <a href="https://pypi.org/project/factor-pricing-model-universe/">\n    <img src="https://img.shields.io/pypi/v/factor-pricing-model-universe.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">\n  </a>\n  <img src="https://img.shields.io/pypi/pyversions/factor-pricing-model-universe.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">\n  <img src="https://img.shields.io/pypi/l/factor-pricing-model-universe.svg?style=flat-square" alt="License">\n</p>\n\nPackage to build universes for factor pricing model. For further details, please refer\nto the [documentation](https://factor-pricing-model-universe.readthedocs.io/en/latest/)\n\n## Installation\n\nInstall this via pip (or your favourite package manager):\n\n`pip install factor-pricing-model-universe`\n\n## Usage\n\nThe library contains the pipelines to build the universe. You can\nrun the pipelines interactively in Jupyter Notebook.\n\n```python\nfrom fpm_universe import pipeline\n```\n\nAlternatively, for scheduled runs, you can create a configuration\nand run the command line entry point to create the universe.\n\n### Configuration\n\nThe configuration is in yaml format and contains a few inputs\n\n|           Name           |                                                                                            Description                                                                                            |\n| :----------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |\n|    `output_filename`     |                                                                                          Output filename                                                                                          |\n| `intermediate_directory` |                                                                       Intermediate directory to export the pipeline outputs                                                                       |\n|     `start_datetime`     |                                                                                  Start datetime of the universe                                                                                   |\n|     `last_datetime`      |                                                                                   Last datetime of the universe                                                                                   |\n|       `frequency`        | Frequency of the universe. For further details, please see the "Offset aliases" in pandas [documentation](https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases) |\n|        `pipeline`        |                                                                             List of pipelines to filter the universe                                                                              |\n|          `data`          |                                                                Defines the data used by pipeline, or referred by yaml tag `!data`                                                                 |\n\nEach pipeline returns a pandas dataframe indicating if the instrument is included into the\nuniverse on the specified date / time. For example, the pipeline returns the following\ndataframe\n\n```\n+------------+--------+-------+\n|    date    |  AAPL  | GOOGL |\n+------------+--------+-------+\n| 2022-11-17 |  True  | False |\n+------------+--------+-------+\n| 2022-11-18 |  True  |  True |\n+------------+--------+-------+\n```\n\nand it indicates AAPL is included in the universe on both 2022-11-17 and 2022-11-18\nwhile GOOGL only on 2022-11-18.\n\nBy default, the pipeline functions are imported from module `fpm_universe.pipeline`.\n\nEach data defines the method to retrieve from the source, or the operator on the\nsource data. The return type of each data is unconstrained. It can be a json-like dict,\na list, a pandas series, or even a pandas dataframe.\n\nIn the configuration, Each data can be referred by yaml tag `!data`, and it is loaded\nin lazy only when it is referred by another data object or a pipeline.\n\n### Command\n\nThe entry point `factor-pricing-model-universe` is to generate the universe regarding\nthe given configuration to the destination, with dynamically passing the parameters\nto format the configuration.\n\nThe arguments of the entry point are\n\n|        Argument        |                   Description                    |\n| :--------------------: | :----------------------------------------------: |\n|  `-c, --config TEXT`   |        Required. Configuration file path.        |\n| `-p, --parameter TEXT` | Parameters to be formatted in the configuration. |\n\nFor example, given the configuration as follows,\n\n```\noutput_filename: "{output_directory}/{date}.parquet"\nintermediate_directory: "{output_directory}/{date}"\nstart_datetime: "2015-01-01"\nlast_datetime: "{date}"\nfrequency: "B"\npipeline:\n  - name: range_validity\n    function: range_validity\n    parameters:\n      values: !data initial_validity\ndata:\n  symbols:\n    function: jq_compile\n    parameters:\n      json_filename: "{data_directory}/index/sp500/default/{date}.json"\n      pattern: "[.[] | .tickers[]] | sort | unique | .[]"\n  initial_validity:\n    function: jq_compile\n    parameters:\n      json_filename: "{data_directory}/listings/{date}.json"\n      pattern: ".[] | {{ symbol: .symbol, valid_start_datetime: .ipoDate, valid_last_datetime: .delistingDate }}"\n      includes:\n        symbol: !data symbols\n```\n\nand run the following command\n\n```\nfactor-pricing-model-universe \\\n  --config <path> \\\n  --parameter output_directory=$HOME/output \\\n  --parameter data_directory=$HOME/data \\\n  --parameter date=2022-10-20\n```\n\nthe universe dataframe is output to `$HOME/output/2022-10-20.parquet`\n(formatted with the parameter `output_directory` and `date`).\n',
    'author': 'Factor Pricing Model',
    'author_email': 'factor.pricing.model@gmail.com',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'https://github.com/factorpricingmodel/factor-pricing-model-universe',
    'package_dir': package_dir,
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'extras_require': extras_require,
    'entry_points': entry_points,
    'python_requires': '>=3.8,<4.0',
}


setup(**setup_kwargs)
