semvec/pypi-packages huggingface dataset:
integrationos-sdk 0.1.1
Python SDK for IntegrationOS API
Requires Python: >=3.7
Keywords: integrationos, api, sdk

# IntegrationOS Python SDK

This Python SDK provides a simple and intuitive way to interact with the IntegrationOS API. It allows you to easily integrate IntegrationOS functionality into your Python applications.

## Features

- Simple and intuitive interface for IntegrationOS API operations
- Support for all CRUD operations (Create, Read, Update, Delete, Count)
- Built-in error handling and request management
- Type hints for improved code completion and error checking in IDEs

## Installation

You can install the IntegrationOS SDK using pip:

```
pip install integrationos-sdk
```

## Usage

Here's a quick example of how to use the IntegrationOS SDK:

```python
from integrationos_sdk import IntegrationOS

# Initialize the SDK with your secret key
integrate = IntegrationOS("your_secret_key")

# Create a model instance (e.g., for customers)
customers = integrate("customers", "your_connection_key")

# List customers
customer_list = customers.list({"limit": 10})
print(f"First customer: {customer_list['unified'][0]['firstName']}")

# Create a new customer
new_customer = customers.create({"firstName": "John", "email": "john@example.com"})
print(f"Created customer: {new_customer['unified']['firstName']}")

# Get a specific customer
customer = customers.get(new_customer['unified']['id'])
print(f"Retrieved customer: {customer['firstName']}")

# Update a customer
updated_response = customers.update(customer['id'], {"firstName": "Jane"})
print(f"Updated customer: {updated_response}")

# Delete a customer
delete_response = customers.delete(customer['id'])
print(f"Delete response: {delete_response}")

# Count customers
customer_count = customers.count()
print(f"Total customers: {customer_count}")
```

## Available Methods

For each model, the following methods are available:

- `list(params: Optional[Dict[str, Any]] = None) -> List[Dict[str, Any]]`
- `create(data: Dict[str, Any]) -> Dict[str, Any]`
- `get(id: Union[str, int]) -> Dict[str, Any]`
- `update(id: Union[str, int], data: Dict[str, Any]) -> Dict[str, Any]`
- `delete(id: Union[str, int]) -> Dict[str, Any]`
- `count() -> int`

## Error Handling

The SDK uses the `requests` library's built-in error handling. If an HTTP error occurs, a `requests.exceptions.HTTPError` will be raised. You can catch and handle these exceptions in your code:

```python
from requests.exceptions import HTTPError

try:
    customers.get("non_existent_id")
except HTTPError as e:
    print(f"An error occurred: {e}")
```

## Contributing

Contributions to the IntegrationOS Python SDK are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Support

If you encounter any problems or have any questions about the SDK, please open an issue on the GitHub repository or contact IntegrationOS support.

---

Remember to replace `"your_secret_key"` and `"your_connection_key"` with your actual IntegrationOS API key and connection key in your code.
py-event-studies 0.2.0
Event Studies Package for CRSP
Requires Python: <3.13,>=3.9

# Python Event Studies

Python package for conducting event studies over the CRSP database.
Enable easy studies with standards methodologies but also implements the one in [the paper ]().

The package do not contains the data, you need to download the data from CRSP.

To install the package use the following command:

```bash
pip install py_event_studies
```

In order to use the package, here is how you can use it:

```python
import py_event_studies as pes

# Load the data (supports csv or parquet files)
# This step will take a little bit of time as it will not only load the data but also preprocess it by pivoting the table in order to be more efficient afterwards.
# It will save a cache file so if you reload the same path it will use the cache. If you changed the data pass the argument no_cache=True
pes.load_data('path/to/your/data.csv')

#If you want to use the Fama-French factors (optional, this step is however very fast as the data is not preprocessed)
pes.load_ff_factors('path/to/your/fama_french_factors.csv')

date = '20120816'

# Get the valid permnos at the date, not needed if you already have a list of permnos
valid_permnos = pes.get_valid_permno_at_date(date)

# Compute the event study for a portfolios
results = pes.compute(date, valid_permnos[np.array([1,10,50,23,35, 102, 55, 66, 548,1002])])

# Display the results statistics for standard tests, also available: cs_test_stats (cross sectionnal), bmp_test_stats (Boehmer, Musumeci and Poulsen (1991)), kp_test_stats (Kolari & Pynnönen (2010))
display(results.std_test_stats)

# In order to plot the prediction made by one of the model for a given cluster size (specify one even if it's a model that do not use one as here)
results.plot(5, 'FF5')

# Summary methods will print results of all tests for all models and all cluster sizes
results.summary()

# Finally you can save the results to an excel file with all results and statistics in different sheets to export it for further analysis
results.to_excel('path_to_save_results.xlsx')
```

## License

Shield: [![CC BY-NC-SA 4.0][cc-by-nc-sa-shield]][cc-by-nc-sa]

This work is licensed under a
[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].

[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]

[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png
[cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg