Skip to content

Instantly share code, notes, and snippets.

@alarictabaries
alarictabaries / ape_codes_with_parents.json
Created September 12, 2024 21:24
Codes APE / NAF avec intitulés et catégories parentes au format JSON
[
{
"code": "01.11Z",
"label": "Cult céréale, légumineuse, graine oléag.",
"parent_code": "01.1",
"parent_label": "Cultures non permanentes",
"parent_parent_code": "01",
"parent_parent_label": "Cult. & prod. animale, chasse & sce ann."
},
{
@alarictabaries
alarictabaries / chercher_entreprises.py
Last active February 22, 2024 14:53
Recherche d'entreprises via l'API recherche-entreprises.api.gouv.fr et insertion dans une base de données Elasticsearch
import requests
from pprint import pprint
from elasticsearch import Elasticsearch, helpers
# Connexion à l'instance ElasticSearch
es = Elasticsearch(hosts="http://elastic:changeme@localhost:9200/")
# On crée une fonction pour récupérer les informations des entreprises
# avec comme argument : page pour la page actuelle que l'on récupère
import epo_ops
import xml.etree.ElementTree as ET
# https://link.epo.org/web/how_to_test_OPS_en.pdf
client = epo_ops.Client(key='', secret='') # Instantiate client
response = client.published_data_search('in all "alaric tabaries"', range_begin=1, range_end=25, constituents=None)
documents = []
# syntax=docker/dockerfile:1.3
# previous command for builder buildkit compatibility, I guess. https://docs.docker.com/engine/reference/builder/
#For the manual installation on which that dockerfile is based go to :https://docs.ip-tools.org/patent2net/index.html
# Run the ubuntu image of docker
FROM centos:8
#Set Environment langage Profile
#ENV container docker
@alarictabaries
alarictabaries / Kibana Dev Tools commands
Created December 7, 2021 11:00
Kibana Dev Tools commands
POST index/_search
{
"query": {
"match": {
"field": "value"
}
},
"fields": [
"field1",
"field2"