semvec/pypi-packages huggingface dataset:
dsolve 0.0.17
Solver of dynamic equations with forward looking variables

# dsolve

`dsolve` is a package to solve systems of dynamic equations in Python. 

## Sequence Space

$$F(X,\mathcal{E})=0$$

$$f_t(x_{t-1},x_{t},x_{t+1},\epsilon_t)=0\qquad \forall t$$



## Symbolic
A package to solve systems of dynamic equations with Python. It understands $\LaTeX$ syntax and it requires minimum specifications from the user end. It solves problems of the form:

$$A_0\begin{bmatrix}x_{t+1}\\ E_{t}[p_{t+1}]\end{bmatrix}=A_1\begin{bmatrix}x_{t}\\ p_{t}\end{bmatrix}+\gamma z_t$$

with $x_t$ given. Following Blanchard Kahn notation, $x_{t}$ are state variables (known at time $t$) while $p_{t}$ are forward-looking variables, and $z_t$ are shocks with $E_t[z_{t+1}]=0$. The solver uses the Klein (2000) algorithm which allows for $A_0$ to be invertible. 

Returns the matrix solution


$$p_t=\Theta_p x_t+Nz_t$$
$$x_{t+1}=\Theta_x x_t+Lz_t$$

and methods to plot impulse responses given a sequence of $z_t$

The main class of the package is `Klein`, which stores and solves the dynamic system. It takes a list of strings that are written as $\LaTeX$ equations, a dictionary that define the numeric values of the parameters, and the specification of `x`, `p` and `z`, specified as a list of $\LaTeX$ strings or a long string separated by commas.  

Usage (for more examples check the [notebook tutorial](https://github.com/marcdelabarrera/dsolve/blob/main/notebooks/dsolve_tutorial.ipynb))
```python
from dsolve.solvers import Klein

# Your latex equations here as a list of strings
eq=[
    '\pi_{t}=\beta*E\pi_{t+1}+\kappa*y_{t}+u_{t}',
    'y_{t}=Ey_{t+1}+(1-\phi)*E[\pi_{t+1}]+\epsilon_{t}',
    '\epsilon_{t} = \rho_v*\epsilon_{t-1}+v_{t}'
]

# Your calibration here as a dictionary
calibration = {'\beta':0.98,'\kappa':0.1,'\phi':1.1,'\rho_v':0.8}

# Define pre-determined variables, forward looking variables, and shocks as strings separated by commas or a list of strings.

x = '\epsilon_{t-1}'
p = '\pi_t, y_t'
z = 'v_t, u_t'

system = Klein(eq = eq, x=x, p=p, z=z, calibration=calibration)

# Simulate the inpulse response of a shock v_{0}=0 for 12 periods when \epsilon_{-1}=0

system.simulate(x0=0, z = {'v_{t}':1}, T=12)
```

## Flexible input reading

The standarized way to write a variable is `E_{t}[x_{s}]` to represent the expectation of `x_{s}` at time `t`. but `dsolve` understands other formats. `Ex_{s}`, `E[x_s]` and `Ex_s` are quivalents to  `E_{t}[x_{s}]`, and the subscript `t` is assumed. 

Greek symbols can be writen as `\rho` or just `rho`. 

`dsolve` understands fractions and sums. `\sum_{i=0}^{2}{x_{i,t}}` produces `x_{0,t}+x_{1,t}+x_{2,t}` and fraction `\frac{a}{b}` produces `(a)/(b)`
poc-poetry-partifact-plugin 0.18.0
A POC poetry plugin that configure partifact
Requires Python: >=3.8,<4.0

## POC-POETRY-PARTIFACT-PLUGIN

This project is a poetry plugin that wraps the `poetry add/install` commands and adds some logic
that will authenticate to AWS CodeArtifact under the hood.

Before any poetry `add` or `install` commands are run, this plugin will check the `pyproject.toml` file
for any codeartifact sources.

It is looking for the first `tool.poetry.source` block that contains `.codeartifact.` in its url. 
The required fields are "url" and "name."

If the tool doesn't find any valid source blocks, nothing happens.

## Configuration

Create a `tool.poetry.source` block in your `pyproject.toml` file, then set the "url" to the CodeArtifact repository url, and set the "name" to the id of the AWS profile you'll be using to authenticate.

Here's an example of a valid `tool.poetry.source` block (the `default=true` is optional):
```yaml
[[tool.poetry.source]]
name = "<your-aws-profile-name>"
url = "https://<your-domain-name>-<your-project-id>.d.codeartifact.<your-region>.amazonaws.com/pypi/<your-repo-name>/simple/"
default = true
```

## Installation

To install the plugin, run this command:

```shell
poetry self add poc-poetry-partifact-plugin
```

## Uninstallation

To remove the plugin, run this command:

```shell
poetry self remove poc-poetry-partifact-plugin
```

## Under the Hood

Once the plugin has gotten your repository url and the name of the AWS profile you'll be using, it  uses the AWS profile credentials located at `~/.aws/credentials` to make an API request to your AWS CodeArtifact repository.

If this request is successful, a short-lived token will be returned that will grant temporary access.
This token is set as a [poetry environment variable](https://python-poetry.org/docs/configuration/#using-environment-variables) and allows poetry to seamlessly authenticate to the repository.

## Dependencies

* [partifact](https://github.com/Validus-Risk-Management/partifact)
AI-Summarizer 1.0.4
AI Summarizer is a Python package that uses OpenAI's GPT-3.5 to summarize any given text.

# AI Summarizer

AI Summarizer is a Python package that uses OpenAI's GPT-3.5 to summarize any given text.
You can input some text describing what kind of information you are interested in. 
When the text is too long it splits it logically into different sections, to make it simpler to summarise

## Installation

You can install AI-Summarizer using pip:

```sh
pip install AI-Summarizer

```

You also need to set up your OpenAI API key, which can be obtained from the OpenAI website. Once you have your API key, create a .env file in the root directory of your project and add the following line:

```py
OPENAI_API_KEY=<your-api-key>
```

Make sure to replace <your-api-key> with your actual API key.

## Usage

Here's a simple example of how to use AI Summarizer. It has been developed to create short summaries that the AI can digest. It should work with any page, but so far it has been only tested with wikipedia pages

```py
from ai_summarizer import summarize_text

text = <insert long wikipedia page text here>

filter = "technological breakthrough"

summary_length = 500

model = "gpt-3.5-turbo"

summary = summarize_text(text, filter=filter, summary_length=summary_length, model=model, max_number_tokens=4096)

print(summary)
```

This example summarizes a text from wikipedia using the summarize_text() function from the AI Summarizer library. The `filter` parameter is used to specify the keywords to include in the summary, the `summary_length` parameter is used to specify the maximum length of the summary, and the `model` parameter is used to specify the GPT-3 model to use.


This will output a summary of (about) the correct length of the given text.

The library includes also a number of other functions that were necessary for it to function,
and could be of great utility for others as well.

```py
def split_text_logically(A: str) --> A_part_1, A_part_2
```

takes some text in markdown format and splits it into two parts. 
The usual way to do this is to split it half way, just keeping some text in common. 
I abhore this practice, as I would abhore reading a book from half a word.
Instead it tries to split it using sections, and if this is not possible sub-sections,
and if this is not possible...

This is useful to analyse the text to summarise easily. But it could be useful for a lot of other reasons too.

```py
def get_number_of_tokens(text,model="gpt-3.5-turbo")
```

this will give you an approximation of how many tokens would this text be, 
if you need to send it to openai. Although if you need this function, you are probably better off just using directly tiktoken and not this which is just a wrap.

```py
def html_to_markdown(html_content,ignore_links=True)
```

This will transform the html text into markdown text. We do this because it is much easier to handle and underastand markdown text for an AI than html which includes a lot of elements unnecessary.


License
AI Summarizer is licensed under the MIT License.