mirror of
https://codeberg.org/Yael-II/ArXtic.git
synced 2026-03-14 22:06:27 +01:00
2025-09-22: Added setup procedure
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,3 +1,8 @@
|
||||
.DS_Store
|
||||
*.tmp
|
||||
*.log
|
||||
tmp/
|
||||
log/
|
||||
venv/
|
||||
.venv/
|
||||
filters/
|
||||
|
||||
20
README.md
20
README.md
@@ -1,5 +1,25 @@
|
||||
# ArXtic: ArXiv T I C
|
||||
|
||||
## Setup
|
||||
|
||||
Clone this repository with:
|
||||
```bash
|
||||
git clone https://codeberg.org/Yael-II/ArXtic/
|
||||
```
|
||||
Create a virtual environment with python using:
|
||||
```bash
|
||||
python3 -m venv venv
|
||||
```
|
||||
If you decide to use a different virtual environment, please change the `VENV_DIR` variable in `cfg/general_config.cfg`. Then, to allow the execution of the setup script, use:
|
||||
```bash
|
||||
chmod u+x setup.sh
|
||||
```
|
||||
and then run:
|
||||
```bash
|
||||
./setup.sh
|
||||
```
|
||||
Finally, you may want to add filters. For each field you want to filter, create a file in the `cfg/filters` directory. The fields that are filtered for each file is specified by `#FIELD="field_name"` in the file. Then, filtered keywords are listed, separated by a line break (one item per line). Then name of the file has no incidence (except for masked files using a `.` (dot), such as `.filename`, which are ignored).
|
||||
|
||||
## Licence
|
||||
|
||||
**ArXtic**
|
||||
|
||||
@@ -36,6 +36,3 @@ FILTERS_DIR="./cfg/filters/"
|
||||
## Remote URLs
|
||||
QUERY_URL="https://export.arxiv.org/api/query?"
|
||||
RSS_URL="https://rss.arxiv.org/atom/astro-ph"
|
||||
|
||||
## FILTERS
|
||||
FILTERS_LIST="authors.txt,keywords.txt"
|
||||
|
||||
3
cfg/requirements.txt
Normal file
3
cfg/requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
feedparser==6.0.12
|
||||
numpy==2.3.3
|
||||
sgmllib3k==1.0.0
|
||||
40
setup.sh
Executable file
40
setup.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
# [TLP:AMBER] LIMITED DISTRIBUTION: WORK IN PROGRESS
|
||||
# Author: Moussouni, Yaël (MSc student; yael.moussouni@etu.unistra.fr)
|
||||
# Institution: Université de Strasbourg, CNRS, Observatoire astronomique
|
||||
# de Strasbourg, UMR 7550, F-67000 Strasbourg, France
|
||||
# Date: 2025-09-22
|
||||
#
|
||||
# Licence:
|
||||
# ArXtic
|
||||
# Copyright (C) 2025 Yaël Moussouni (yael.moussouni@etu.unistra.fr)
|
||||
#
|
||||
# setup.sh
|
||||
# Copyright (C) 2025 Yaël Moussouni (yael.moussouni@etu.unistra.fr)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see www.gnu.org/licenses/.
|
||||
|
||||
source activate.sh
|
||||
|
||||
echo "=== [ Directory setup ] ==="
|
||||
mkdir -p -v cfg/filters
|
||||
mkdir -p -v db
|
||||
chmod u+x *.sh
|
||||
echo "=== Done ==="
|
||||
|
||||
echo "=== [ Python environment setup ] ==="
|
||||
echo "--> pip"
|
||||
${VENV_DIR}bin/pip3 install -r cfg/requirements.txt
|
||||
echo "=== Done ==="
|
||||
echo ""
|
||||
@@ -37,7 +37,6 @@ FILTERS_DIR = os.environ.get("FILTERS_DIR")
|
||||
DB_DIR = os.environ.get("DB_DIR")
|
||||
QUERY_URL = os.environ.get("QUERY_URL")
|
||||
RSS_URL = os.environ.get("RSS_URL")
|
||||
FILTERS_LIST = os.environ.get("FILTERS_LIST").split(",")
|
||||
|
||||
COLOUR_DEFAULT="\033[0m"
|
||||
COLOUR_INPUT="\033[36m"
|
||||
@@ -78,8 +77,9 @@ def print_entries(entries, fields=None):
|
||||
|
||||
def get_filters():
|
||||
filters = []
|
||||
for i in range(len(FILTERS_LIST)):
|
||||
path = FILTERS_DIR + FILTERS_LIST[i]
|
||||
filters_list = [f for f in os.listdir(FILTERS_DIR) if not f[0] == "."]
|
||||
for i in range(len(filters_list)):
|
||||
path = FILTERS_DIR + filters_list[i]
|
||||
filter_file = open(path)
|
||||
dic = {"fields": [], "values": []}
|
||||
for line in filter_file.readlines():
|
||||
@@ -121,4 +121,5 @@ def today_arxiv():
|
||||
print_entries(entries, fields)
|
||||
return entries, fields
|
||||
|
||||
## Find using arxiv id
|
||||
today_arxiv()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user