semvec/pypi-packages huggingface dataset:
tldparse 1.0.5
Parse a given domain and split it into its subdomain, domain and top-level domain parts.
License: MIT
Keywords: domain parser tld top-level domain subdomain

# TLDParse

Split a given domain into its different parts (subdomain, domain, suffix).

It was built in the aim to be very fast. To do so, it starts in reverse, going from the TLD down to any subdomains.

## Installation

```python
pip install tldparse
```

## Basic usage

The following code will show you the basic usage you can have from this library.

```python
from tldparse import DomainResult

parsed = DomainResult('https://example.github.io/with/some/path')
print(parsed.tld) # io
print(parsed.domain) # github
print(parsed.subdomain) # example
```

## Common usage

A common usage is to check whereas the given domain is the fqdn or if it has subdomains

```python
from tldparse import DomainResult

email = 'user@sub.domain.com'
mbox, domain = email.split('@')

parsed = DomainResult(domain)
assert parsed.fqdn == domain, "Please register using a domain with no subdomain parts"
```

## Advanced usage

### Replacing TLDParse with a custom one:

`DomainResult` class use the default `TLDParse` object that relies on the list of suffixes provided by Mozilla.
(The list is freely available at https://publicsuffix.org/list/public_suffix_list.dat)

But you can either pass another parser, such as:

```python

class MyCustomParser:
    def __call__(self, domain, private=True):
        # PLEASE DON'T DO THAT
        return domain.rsplit('.', 2)  # Consider a TLD has only one part. Ignores things such as ".co.uk"

from tldparse import DomainResult

parser = MyCostumParser()

result = DomainResult('example.github.com', parser=parser)
print(result.fqdn)  # github.com

result = DomainResult('bbc.co.uk', parser=parser)
print(result.fqdn)  # co.uk  # Too bad
```

### Using private subdomains:

By default, the library will consider the subdomains as part of the fqdn for certain domain.
But you can change this behavior by setting the `private` parameter to `True`.

```python
from tldparse import DomainResult

result = DomainResult('example.github.io')
print(result.fqdn) # example.github.io

result = DomainResult('example.github.io', private=False)
print(result.fqdn) # github.io
```

### Adding/Removing TLDs entries:

You can add/remove entries to the parser by using the `add`/`remove` methods of the tldparse object:

```python
from .tldparse import TLDParse, DomainResult

# Adding a custom domain
parser.add('weebly.co.uk')  # added in private
result = DomainResult('example.weebly.co.uk', parser=parser, private=False)
print(result.suffix)  # 'co.uk'
print(result.domain)  # 'weebly'
print(result.subdomain)  # 'example'

result = DomainResult('example.weebly.co.uk', parser=parser)
print(result.suffix)  # 'weebly.co.uk'
print(result.domain)  # 'example'

# Removing a domain
TLDParse.remove('github.io')
result = DomainResult('example.github.io')
print(result.suffix)  # 'io'
print(result.domain)  # 'github'
print(result.subdomain)  # 'example'
```

## Support

If you find an issue, please open a support requests, or even better, a Pull Requests :)

Thank you!
pystockfilter 2.3.1
Intelligent Stock Screening for Informed Investment Decisions
License: MIT
Requires Python: <4.0,>=3.11

# PyStockFilter

![Release Build](https://github.com/portfolioplus/pystockfilter/workflows/Release%20Build/badge.svg)
![CI Build](https://github.com/portfolioplus/pystockfilter/workflows/CI/badge.svg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/pystockfilter?style=plastic)
[![Coverage Status](https://coveralls.io/repos/github/portfolioplus/pystockfilter/badge.svg?branch=master)](https://coveralls.io/github/portfolioplus/pystockfilter?branch=master)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ac0c6fc68b74408c976007bd3db823f0)](https://www.codacy.com/gh/portfolioplus/pystockfilter/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=portfolioplus/pystockfilter&amp;utm_campaign=Badge_Grade)

PyStockFilter is a Python library that allows users to create custom stock filters using a range of fundamental and technical indicators. With support for data sources like Yahoo Finance, local data, and `pystockdb`, PyStockFilter is a versatile solution for building and backtesting technical and fundamental trading strategies.

## Features

- **Data Compatibility**: Integrates with Yahoo Finance, local data, and `pystockdb`.
- **Built-in Indicators**: Includes essential technical indicators, and supports custom indicator creation.
- **Backtesting**: Enables testing of strategies on historical data.
- **Optimization Tools**: Offers parameter optimization, including sequential and chunked data optimization.
- **Custom Strategy Support**: Extendable with your own strategies and indicators.

## Built-in Filters

### Technical Filters
PyStockFilter includes several popular technical indicators, which can be used out of the box or customized:

- **Simple Moving Average (SMA)**
- **Exponential Moving Average (EMA)**
- **Relative Strength Index (RSI)**
- **Ultimate Oscillator (UO)**
- **Moving Average Convergence Divergence (MACD)**
- **Bollinger Bands (BB)**

For custom indicators, refer to the examples in the `src/pystockfilter/strategy` directory.

## Installation

To install PyStockFilter, run:

```shell
pip install pystockfilter
```

## Quick Start Guide

For detailed examples on setting up strategies, defining parameters, and running the optimizer, please visit the [Examples Directory](https://github.com/portfolioplus/pystockfilter/tree/master/examples) in the PyStockFilter repository.

## Issue Tracker

Report issues, request features, or contribute via the GitHub Issue Tracker:

[PyStockFilter Issue Tracker](https://github.com/portfolioplus/pystockfilter/issues)


## Disclaimer

This software is for educational purposes only. Do not risk money which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.