semvec/pypi-packages huggingface dataset:
test-opulentfox-29 0.0.0
descipt
Requires Python: >=3.9

This is not an official python ProtonMail API client. it allows you to read, send and delete messages in protonmail, as well as render a ready-made template with embedded images.

> Unfortunately, I could not find an analogue of DecryptSessionKeys from OpenPG.js, so this uses Playwright to execute js. if you have any ideas write to me

## Installation
Install requirements:
``` 
pip install protonmail-api-client
```
Install Playwright:
```
playwright install
```

# Getting Started
### Get PGP private key and passphrase
Go to the [Email encryption keys](https://account.proton.me/u/0/mail/encryption-keys#addresses) section, click on "Export private key" (NOT the Account keys), create the passphrase.
![1.png](/assets/1.png)

```py
from protonmail.client import ProtonMail

username = "YouAddress@proton.me"
password = "YourPassword123"

proton = ProtonMail()
proton.login(username, password)

private_key = 'privatekey.YourAddress@proton.me-123...89.asc'
passphrase = 'YourPassphrase'
proton.pgp_import(private_key, passphrase=passphrase)

# Get a list of all messages
messages = proton.get_messages()

# Read the latest message
message = proton.read_message(messages[0])
print(message.sender.address)  # sender address
print(message.subject)  # subject
print(message.body)
# <html><body><div>it's my image: <img src="cid:1234@proton.me">....

# Render the template, images downloading, converting to BASE64 and insert into html
proton.render(message)
# This is a ready-made html page, with all the pictures, you can save it right away
with open('message.html', 'w', encoding='utf-8') as f:
    f.write(message.body)
print(message.body)
# <html><body><div>it's my image: <img src="data:image/png;base64, iVBORw0K..">....

# Download file from message
first_file = message.attachments[0]
proton.download_files([first_file])
with open(f'{first_file.name}', 'wb') as f:
    f.write(first_file.content)

# Send message
recipients = ["to@proton.me", "to2@proton.me"]
subject = "My first message"
body = "<html><body>hello, i sent my first mail!</body></html>"  # html or just text

new_message = proton.create_message(
    recipients=recipients,
    subject=subject,
    body=body
)

sent_message = proton.send_message(new_message)

# Delete messages
proton.delete_messages([message])

# Save session, you do not have to re-enter your login, password, pgp key, passphrase
# WARNING: the file contains sensitive data, do not share it with anyone,
# otherwise someone will gain access to your mail.
proton.save_session('session.pickle')

# Load session
proton = ProtonMail()
proton.load_session('session.pickle')

# Getting a list of all sessions in which you are authorized
proton.get_all_sessions()

# Revoke all sessions except the current one
proton.revoke_all_sessions()
```
pytds-md5 0.0.2
A small example package
Requires Python: >=3.6


# Make sure you have upgraded version of pip
Windows
```
py -m pip install --upgrade pip
```

Linux/MAC OS
```
python3 -m pip install --upgrade pip
```

## Create a project with the following structure
```
packaging_tutorial/
├── LICENSE
├── pyproject.toml
├── README.md
├── setup.cfg
├── src/
│   └── example_package/
│       ├── __init__.py
│       └── example.py
└── tests/
touch LICENSE
touch pyproject.toml
touch setup.cfg
mkdir src/mypackage
touch src/mypackage/__init__.py
touch src/mypackage/main.py
mkdir tests
```

## pyproject.toml 

This file tells tools like pip and build how to create your project

```
[build-system]
requires = [
    "setuptools>=42",
    "wheel"
]
build-backend = "setuptools.build_meta"
```
build-system.requires gives a list of packages that are needed to build your package. Listing something here will only make it available during the build, not after it is installed.

build-system.build-backend is the name of Python object that will be used to perform the build. If you were to use a different build system, such as flit or poetry, those would go here, and the configuration details would be completely different than the setuptools configuration described below.


# Setup.cfg setup
Using setup.cfg is a best practice, but you could have a dynamic setup file using setup.py

```
[metadata]
name = example-pkg-YOUR-USERNAME-HERE
version = 0.0.1
author = Example Author
author_email = author@example.com
description = A small example package
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/pypa/sampleproject
project_urls =
    Bug Tracker = https://github.com/pypa/sampleproject/issues
classifiers =
    Programming Language :: Python :: 3
    License :: OSI Approved :: MIT License
    Operating System :: OS Independent

[options]
package_dir =
    = src
packages = find:
python_requires = >=3.6

[options.packages.find]
where = src

```
# Running the build
### Make sure your build tool is up to date
Windows
```
py -m pip install --upgrade build
```
Linux/MAC OS
```
python3 -m pip install --upgrade build
```


### Create the build
```
py -m build
```













### References
https://packaging.python.org/tutorials/packaging-projects/
shapecms 0.0.11
A composable content management system
Requires Python: >=3.10

# Shape CMS

Shape CMS is a composable content management system that plugs into your Python project giving you full freedom in building sites. 
It comes with an admin panel that builds itself based on the data models you create while leaving everything else up to you.

Shape CMS leverages the Flask framework under-the-hood, so you also get the full power of Flask when building apps with Shape CMS.

**Note:** There's no stable release yet, so documentation is subject to change, and I would not recommend running it in production.

## Installation

```shell
pip install shapecms
```

## Example app

A minimal example looks like this:

```python
from shapecms import ShapeCMS
from shapecms import PageView


class HomeView(PageView):
    def get(self):
        return "Hello, world."


shape = ShapeCMS(__name__, "sqlite:///demo.db")
shape.add_url("/", HomeView, "home")


def create_app():
    instance = shape.start()
    instance.secret_key = "super-secret-key"

    return instance
```

The admin panel is automatically available at the `/admin` path. If it's your first time going to the admin panel, it will guide you through a set-up process. 

Note however that until you add any Content Shapes the admin panel will be empty as it will have no info on how to construct itself.

## Adding Content Shapes

To be written.