# Poetry

## Install

```
pip install poetry
```

## Usage

```
# Create new project with command: poetry new [project_name]
poetry new poetry-demo

# Example directory structure
poetry-demo
├── pyproject.toml
├── README.rst
├── poetry_demo
│   └── __init__.py
└── tests
    ├── __init__.py
    └── test_poetry_demo.py
    
# or you can create folder then go inside and initialise poetry which will create pyproject.toml
poetry init

# Go to directory
cd poetry-demo

# now you can add dependency, for example:
poetry add alembic

#this will add dependency in pyproject.toml file

# new shell
poetry shell
exit

# manual activation
source {path_to_venv}/bin/activate
deactivate

source`poetry env info --path`/bin/activate

installing dependency
poetry install

```

## Issues

```
# Resoloving dependencies taking a long time? Use the following:
poetry cache clear pypi --all
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lukasz-nowakiewicz.gitbook.io/resources/python/poetry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
