semvec/pypi-packages huggingface dataset:
nsescraper 0.0.8
A scraper for https://www.nseindia.com
License: MIT
Requires Python: >=3.8
Keywords: python, NSE, NIFTY, scraping

<!-- ```text

███    ██ ███████ ███████ ███████  ██████ ██████   █████  ██████  ███████ ██████  
████   ██ ██      ██      ██      ██      ██   ██ ██   ██ ██   ██ ██      ██   ██ 
██ ██  ██ ███████ █████   ███████ ██      ██████  ███████ ██████  █████   ██████  
██  ██ ██      ██ ██           ██ ██      ██   ██ ██   ██ ██      ██      ██   ██ 
██   ████ ███████ ███████ ███████  ██████ ██   ██ ██   ██ ██      ███████ ██   ██ 
                                                                            
``` -->
<div align="center">
	<img src="https://raw.githubusercontent.com/U77w41/nsescraper/e9f646316e88cabc14178279459e3066a5fcf5a9/nsescraper/nsescraper.svg" />
</div>
<p align="center">
  <a href="https://pypi.org/project/nsescraper"><img alt="PyPI Version" src="https://img.shields.io/pypi/v/nsescraper.svg?maxAge=86400" /></a>
  <a href="https://pypi.org/project/nsescraper"><img alt="Python Versions" src="https://img.shields.io/pypi/pyversions/nsescraper.svg?maxAge=86400" /></a>
</p>

**nsescraper** is an open-source python package to scrap data from nseindia.com.

## Installation

To install using pip, use

``` python
pip install nsescraper
```

**nsescraper** requires [Python 3](https://www.python.org/) and [Pandas](https://pandas.pydata.org/) to execute.

## Features:

**nsescraper** package contains different functions such as:

- **intraday_index**: Scrapes intra day data for any index from NSE
- **intraday_stock**: Scrapes intra day data for any listed stock from NSE

## Usage

* **Import the library**:

``` python
from nsescraper import *
```
* **Choose a method:**

To scrap Bulk/Block deals data

``` python
from nsescraper import Stock
stock = Stock('usha mart')
stock.bulk_deals()
```

To scrap trading reports
``` python
from nsescraper import Stock
stock = Stock('usha mart')
stock.trade_reports()
```

To scrap current days nse index/stock data as 1 minute candle format

``` python
intraday_index("nifty 50")
```

``` python
intraday_stock("britannia")
```

To scrap current days nse index/stock data as 1 second tick format

``` python
intraday_index("nifty midcap 100", tick= True)
```

``` python
intraday_stock("dr reddy", tick= True)
```

To scrap current days nse index/stock data as required length minute candle

```python
intraday_index("nifty energy", candlestick= 10)
```

```python
intraday_stock("Zomato", candlestick= 69)
```

To scrap historical nse index/stock data

```python
historical_index('NIFTY 50')
```

```python
historical_stock('ABB')
```
siwar-api 0.1.0
Python wrapper for the Siwar Arabic Lexicon API
License: MIT
Requires Python: >=3.10
Keywords: arabic, dictionary, lexicon, nlp, language

# Siwar API

[![PyPI version](https://badge.fury.io/py/siwar-api.svg)](https://badge.fury.io/py/siwar-api)
[![Python Package](https://github.com/osama-ata/siwar-api/actions/workflows/python-package.yml/badge.svg)](https://github.com/osama-ata/siwar-api/actions/workflows/python-package.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A Python wrapper for the Siwar Arabic Lexicon API (siwar.ksaa.gov.sa). This library provides easy access to Arabic lexical data, word meanings, roots, patterns, and morphological information.

## Installation

```bash
pip install siwar-api
```

## Quick Start

- Obtian an [API key](https://siwar.ksaa.gov.sa/developers).

```python
from siwar import SiwarClient

# Initialize client
client = SiwarClient(api_key='your-api-key')

# Search public entries
results = client.search_public('محرك')

# Get lexicon information
lexicons = client.get_public_lexicons()

# Get word details
senses = client.get_entry_senses('محرك')
conjugations = client.get_entry_conjugations('محرك')
```

## Features

- Complete coverage of Siwar API endpoints
- Support for both public and private lexicon access
- Rich Arabic language processing utilities
- Type hints for better IDE support
- Comprehensive error handling
- Detailed documentation

## Documentation

For full documentation and examples, visit our [GitHub Wiki](https://github.com/osama-ata/siwar-api/wiki).

## Contributing

We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

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

## Acknowledgments

- [Siwar Arabic Lexicon](https://siwar.ksaa.gov.sa) for providing the API
- All our [contributors](CONTRIBUTORS.md)
- [API documentaion](https://siwar.ksaa.gov.sa/api-external)

## Support

If you encounter any problems or have suggestions, please [open an issue](https://github.com/osama-ata/siwar-api/issues/new/choose).
lantern-pinecone 0.0.8
Pinecone compatiable client for Lantern
License: MIT
Requires Python: >=3.8

# Pinecone-API-Compatible Lantern Client

## Install

```sh
pip install lantern-pinecone
```

## Sync from Pinecone to Lantern

```python
import lantern_pinecone
from getpass import getpass

lantern_pinecone.init('postgres://postgres@localhost:5432')

pinecone_ids = list(map(lambda x: str(x), range(100000)))

index = lantern_pinecone.create_from_pinecone(
        api_key=getpass("Pinecone API Key"),
        environment="us-east-1-aws",
        index_name="sift100k",
        namespace="",
        pinecone_ids=pinecone_ids,
        recreate=True,
        create_lantern_index=True)

index.describe_index_stats()

index.query(top_k=10, id='45500', namespace="")
```

> **_NOTE:_** If you pass `create_lantern_index=False` only data will be copied under the table of your index name (in this example `sift100k`) and you can create an index later externally. Without the index most of the index operations will not be accessible via this client.

## Extract Metadata Fields

When copying from Pinecone we create a table in this structure: `sql (id TEXT, embedding REAL[], metadata jsonb)`
If you are planning to use the index with raw sql clients, you may want to extract metadata into separate columns, so you could have more complex/nice looking queries over your metadata fields.
So if our metadata has this shape `{ "title": string, "description": string }`, we can extract it using this query:

```sql
BEGIN;
ALTER TABLE sift100k
ADD COLUMN title TEXT,
ADD COLUMN description TEXT;

-- Update the new columns with data extracted from the JSONB column
UPDATE sift100k
SET
  title = metadata->>'title',
  description = metadata->>'description';


-- Optionally drop the metadata column
ALTER TABLE sift100k DROP COLUMN metadata;

COMMIT;
```

After doing this your index will most likely be uncomaptible with this python client, and you should use it via raw sql client like `psycopg2`

## Index operations

```python
import os
import lantern_pinecone
import pandas as pd

LANTERN_DB_URL = os.environ.get('LANTERN_DB_URL') or 'postgres://postgres@localhost:5432'
lantern_pinecone.init(LANTERN_DB_URL)

# Giving our index a name
index_name = "hello-lantern"

# Delete the index, if an index of the same name already exists
if index_name in lantern_pinecone.list_indexes():
    lantern_pinecone.delete_index(index_name)


import time

dimensions = 3
lantern_pinecone.create_index(name=index_name, dimension=dimensions, metric="cosine")
index = lantern_pinecone.Index(index_name=index_name)


df = pd.DataFrame(
    data={
        "id": ["A", "B"],
        "vector": [[1., 1., 1.], [1., 2., 3.]]
    })

# Insert vectors
index.upsert(vectors=zip(df.id, df.vector))

index.describe_index_stats()

index.query(
    vector=[2., 2., 2.],
    top_k=5,
    include_values=True) # returns top_k matches


lantern_pinecone.delete_index(index_name)
```
lantern-client 0.0.6
Python client for Lantern
License: MIT
Requires Python: >=3.8

# Python Client for Lantern

## Install

```sh
pip install lantern-client
```

## Basic usage

```python
from lantern import SyncClient

# Initialize the SyncClient with the database URL and table configuration
DB_URL="postgresql://postgres@localhost:5432/lantern"
client = SyncClient(url=DB_URL, table_name="small_world", dimensions=3, distance_type="l2sq", m=12, ef=64, ef_construction=64)

# Attempt to drop the existing table if it exists
try:
  client.drop()
except:
  print(f"An error occurred while dropping the table: {e}")

# Create a new table
client.create_table()

# Bulk insert data into the table
client.bulk_insert([
  ("1", [0,0,0], { "name": "a" }),
  ("2", [0,1,0], { "name": "b" }),
  ("3", [0,0,1], { "name": "c" })
])

# Create an index to optimize search queries
client.create_index()

# Retrieve a specific record by ID, selecting only certain fields
vec_by_id = client.get_by_id(id="1", select_fields=["id", "metadata"])
assert(vec_by_id.embedding is None)

# Retrieve a record by ID without field restrictions
vec_by_id = client.get_by_id("1")
assert(vec_by_id.id == "1")

# Retrieve multiple records by their IDs
vectors_by_ids = client.get_by_ids(["1", "3"])
assert(len(vectors_by_ids) == 2)
assert(vectors_by_ids[0].id == "1")
assert(vectors_by_ids[1].id == "3")

# Insert or update a single record
client.upsert(("4", [1,0,0], { "name": "d" }))

# Update the metadata of a record by its ID
client.update_by_id(id="4", metadata={ "name": "4" })

# Get the total number of records in the table
row_count = client.count()
assert(row_count == 4)

# Retrieve a record by ID, selecting specific fields
vec_by_id = client.get_by_id(id="4", select_fields=["id", "embedding", "metadata"])
assert(vec_by_id.metadata['name'] == "4")

# Search for vectors similar to the one with ID "4"
vectors = client.search(query_id="4")
assert(len(vectors) == row_count)
assert(vectors[0].id == "4")
assert(vectors[0].distance == 0)

# Search for vectors using the embedding of the vector with ID "4"
# Limit the results to 2 and apply a filter on the metadata
vectors = client.search(query_embedding=vec_by_id.embedding, limit=2, filter={"name": "a"}, select_fields=["id"])
assert(len(vectors) == 1)
assert(vectors[0].id == "1")
assert(vectors[0].metadata is None)
assert(vectors[0].embedding is None)

```
lantern-django 0.0.1
Django client for Lantern
License: MIT
Requires Python: >=3.8

# Django Client for Lantern

## Install

```sh
pip install lantern-django
```

## Basic usage

Create a migration to enable the extensions:

```python
from django.db import migrations
from lantern_django import LanternExtension, LanternExtrasExtension

class Migration(migrations.Migration):
    operations = [
        LanternExtension(),
        LanternExtrasExtension(),
    ]
```

Add a `REAL[]` field to your model

```python
from django.db import models
from django.contrib.postgres.fields import ArrayField
from lantern_django import RealField

class Item(models.Model):
    embedding = ArrayField(RealField(), size=3, null=True)
```

Insert a vector

```python
item = Item(embedding=[1, 2, 3])
item.save()
```

Get the nearest neighbors to a vector

```python
from lantern_django import L2Distance

Item.objects.order_by(L2Distance('embedding', [3, 1, 2]))[:5]
```

Get nearest neighbors to a text embedding

```python
distance = L2Distance('embedding', TextEmbedding(
            'BAAI/bge-small-en', 'hello'))
        results = Item.objects.annotate(distance=distance).order_by('distance')[:5]
```

Get the distance

```python
Item.objects.annotate(distance=L2Distance('embedding', [3, 1, 2]))
```

Get items within a certain distance

```python
Item.objects.alias(distance=L2Distance('embedding', [3, 1, 2])).filter(distance__lt=5)
```

Add an index

```python
from lantern_django import HnswIndex

class Item(models.Model):
    class Meta:
        indexes = [
            HnswIndex(
                name='hnsw_idx',
                fields=['embedding'],
                m=16,
                ef=64,
                ef_construction=64,
                dim=384,
                opclasses=['dist_l2sq_ops']
            )
        ]
```
django-actual-admin-docs 0.5
Render Markdown documentation in the Django Admin.
License: MIT
Requires Python: <4.0,>=3.9

# django-actual-admin-docs

Render Markdown documentation directly in the Django admin`.

- Support for nested subfolders
- Comprehensive Markdown format (link to which spec)
- Provides default styles for Markdown rendering

## Installation

1. Install the `django-actual-admin-docs` package. If you have `pygments` installed, code blocks are automatically highlighted.

2. Add `actual_admin_docs` to your `INSTALLED_APPS` setting:

   ```python 
   INSTALLED_APPS = [
     "django.contrib.admin",
     "actual_admin_docs",
     ...
   ]
   ```
   
3. Add the documentation urlpattern, above your admin urls:

   ```python
   from django.contrib import admin
   from django.urls import include, path
   
   urlpatterns = [
       path("admin/docs/", include("actual_admin_docs.urls")),
       path("admin/", admin.site.urls),
   ]
   ```
4. Add a `DOCS_ROOT` setting which should be a `pathlib.Path` pointing to the docs directory:

   ```python 
   DOCS_ROOT = BASE_DIR / "docs"
   ```

## Documentation folder structure

You can use folders, subfolders, files in folders, etc.

```
🗂 docs/
│
├── 🗂 subfolder   
│   │   
│   ├── 🗂 subfolder with spaces
│   │   └── 📝 another-file.md
│   │ 
│   ├── 📝 another-file.md
│   └── 📝 index.md
│
├── 🗂 img    
│   └── 🌁 cat_studying_glasses.jpg
│
├── 📝 index.md
└── 📝 markdown-sample.md
```

Use regular Markdown links to link to other documents or objects:

```markdown
A link to [another document](./markdown-sample.md) is just a regular Markdown link. Documents in subdirectories [are supported too](./subfolder/another-file.md).

For images, downloads etc. use regular markdown markup too:

![A cat judging your code](./img/cat_studying_glasses.jpg)
[Click to download](./img/./img/cat_studying_glasses.jpg)
```

## Custom CSS

Overwrite the `actual-admin-docs.css` file to add your custom styles.


-----

# 🤺 Local Development

```bash
$ poetry install
$ poetry run pytest
$ DJANGO_SETTINGS_MODULE=actual_admin_docs.tests.testproject.settings poetry run django-admin runserver
```
# Changelog

## v0.5 2024-11-06

- Removed 'highlight' extras marker. If `pygments` is installed, code blocks are highlighted, and if not, then not. 

## v0.4 2024-11-06

- Sample documentation for testing purpose is now part of the module.
- Added testing with docs.

## v0.3 2024-11-06

- Improved local test setup,
- Index files are consistently recognized in subfolders.
- Pygments as a dependency is now optional.

## v0.2 2024-11-05

- Added syntax highlighting for fenced code blocks.
- Added Pygments as a dependency.

## v0.1 2024-11-05

- Initial version.