markdownn too to create table of content from jupyter notebooks
Project description
# Toci
Solring is an easy-to-use import tool from solr to local storage. By supporting various options we can create custom
queries and save from a running Solr server to a file.
## How it works
```
$ pip install toci==0.0.1
$ solring --help
usage: Solring.py [-h] [--version] --url URL [--output OUTPUT]
[--save_format {csv,txt}] --core CORE [--rows ROWS] [-fl FL]
[-q Q] [-fq FQ] [--score] [--qt QT]
{group} ...
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
--url URL, -u URL The host:port of the running solr.
--output OUTPUT, -o OUTPUT
Output file name.
--save_format {csv,txt}, -sf {csv,txt}
File type of saved records. Default is txt.
--core CORE, -c CORE The core/collection in solr.
--rows ROWS, -r ROWS The number of row numbers returned. By default, Solr
returns 5 batches at a time to save records.
-fl FL Field list to retrieve. By default, Solr returns the
id field.
-q Q Search query. By default, Solr returns all records.
-fq FQ Filter queries.
--score Learn score of each record in a score field.
--qt QT solr request handle to query on, default is '/select'.
group command:
{group} group help
```
The group command parameters:
```
$ solring group --help
usage: Solring.py group [-h] --group_fl GROUP_FL --group_agg
{mean,min,max,count} --group_column GROUP_COLUMN
optional arguments:
-h, --help show this help message and exit
--group_fl GROUP_FL The field(s) we want to use to group by.
--group_agg {mean,min,max,count}
Aggregation functions to use in group by. Default is
count.
--group_column GROUP_COLUMN
The field(s) where we want to aggregate.
```
Create a custom query where the query we search for is 'boat', we have two filter queries, and we only need to know
their ids and titles as follows:
```
solring --url http://127.0.0.1:8983\
-c boats \
-fq "cabin:[6 TO *]" \
-fq harbors:marmaris \
-q boat \
-fl id,title,boat_size,group_id
$ ls
output.txt
```
Let's now aggregate the above request with group options. We can learn the min and max of boats_size of each group:
```
solring --url http://127.0.0.1:8983\
-c boats \
-fq "cabin:[6 TO *]" \
-fq harbors:marmaris \
-q boat \
-r 100 \
-fl id,title,boat_size,group_id \
-o groupby_boats \
group --group_agg min --group_agg max --group_column boat_size --group_fl group_id
$ ls æ
groupby_boats.txt
```
## LICENSE
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
toci-0.0.1.tar.gz
(4.6 kB
view details)
Built Distributions
toci-0.0.1-py3.9.egg
(6.2 kB
view details)
toci-0.0.1-py3-none-any.whl
(4.8 kB
view details)
File details
Details for the file toci-0.0.1.tar.gz
.
File metadata
- Download URL: toci-0.0.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01fdbc0b763c545c52b183d415d0c820787d9f281348f7b8d84edf9246a0caa7 |
|
MD5 | a31b74728b0d83aa72640ad2c4bdb925 |
|
BLAKE2b-256 | b4d780a4008e51317e62f0d695053e8d805a63811f82642e3e2ec51f4e28afdb |
File details
Details for the file toci-0.0.1-py3.9.egg
.
File metadata
- Download URL: toci-0.0.1-py3.9.egg
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90673e7630e876a1de1aef4e386ee1917c6d6f7796080aa8373869b42ba63584 |
|
MD5 | 0dccf20049266f0eeff726aca405d540 |
|
BLAKE2b-256 | d4fcb878b3486d66ab94a9af3d02f528616c99e2c2503545d1bc92c33519eadb |
File details
Details for the file toci-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: toci-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 842d16b1a982060191c2423c54fe6dc52ef43ae7f8ca0b1698525286f741c888 |
|
MD5 | 2f4363fb39afd8c08c2d6774fda7f489 |
|
BLAKE2b-256 | 50eef1d8f92f9acaeca5bb12b5c15d6e6b9369ce9cccbef9e5cf7b6d0ee00a5a |