{"id":21701054,"url":"https://github.com/renatoelho/funcoes-sql-udf-python","last_synced_at":"2026-05-10T05:49:37.018Z","repository":{"id":246340348,"uuid":"820784281","full_name":"Renatoelho/Funcoes-SQL-UDF-Python","owner":"Renatoelho","description":"Este repositório demonstra como criar e utilizar Funções Definidas pelo Usuário (UDF) no DuckDB usando Python. As UDFs permitem estender a funcionalidade SQL padrão, permitindo que você escreva funções personalizadas em Python e as utilize diretamente nas suas consultas SQL no DuckDB.","archived":false,"fork":false,"pushed_at":"2024-06-30T08:29:44.000Z","size":456,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T15:09:38.917Z","etag":null,"topics":["duckdb","jupyter-notebook","python","sql","udf"],"latest_commit_sha":null,"homepage":"https://renato.tec.br/Vídeos","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Renatoelho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-27T07:09:53.000Z","updated_at":"2024-06-30T08:29:47.000Z","dependencies_parsed_at":"2024-06-27T09:04:44.686Z","dependency_job_id":"e6426d07-7d11-4ddf-a914-86299ad5e23a","html_url":"https://github.com/Renatoelho/Funcoes-SQL-UDF-Python","commit_stats":null,"previous_names":["renatoelho/funcoes-sql-udf-python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Renatoelho%2FFuncoes-SQL-UDF-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Renatoelho%2FFuncoes-SQL-UDF-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Renatoelho%2FFuncoes-SQL-UDF-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Renatoelho%2FFuncoes-SQL-UDF-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Renatoelho","download_url":"https://codeload.github.com/Renatoelho/Funcoes-SQL-UDF-Python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244645258,"owners_count":20486954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["duckdb","jupyter-notebook","python","sql","udf"],"created_at":"2024-11-25T20:17:47.366Z","updated_at":"2026-05-10T05:49:36.984Z","avatar_url":"https://github.com/Renatoelho.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Criando Funções SQL (UDF) no DuckDB com Python\n\nEste repositório demonstra como criar e utilizar ***Funções Definidas pelo Usuário*** (UDF) no ***DuckDB*** usando ***Python***. As UDFs permitem estender a funcionalidade SQL padrão, permitindo que você escreva funções personalizadas em Python e as utilize diretamente nas suas consultas SQL no DuckDB. Isso é particularmente útil para realizar operações complexas de manipulação de dados que não são facilmente alcançadas com o ***SQL*** padrão. Por exemplo, criamos uma UDF simples que verifica se o dígito verificador (DV) de um ***CPF*** é composto apenas por números. Este exemplo ilustra o potencial das UDFs para realizar ***operações complexas*** de manipulação de dados diretamente no DuckDB, permitindo soluções avançadas e personalizadas para diversas necessidades de processamento.\n\n\u003c!--\nhttps://www.youtube.com/@renato-coelho\n--\u003e\n\n# Apresentação em vídeo\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://youtu.be/FwYVfnteAO8\" target=\"_blank\"\u003e\u003cimg src=\"thumbnail/Funcoes-SQL-UDF-Python.png\" alt=\"Vídeo de apresentação\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n### Requisitos\n\n+ ![Git](https://img.shields.io/badge/Git-2.25.1%2B-E3E3E3)\n\n+ ![Ubuntu](https://img.shields.io/badge/Ubuntu-20.04%2B-E3E3E3)\n\n+ ![Python](https://img.shields.io/badge/Python-3.8%2B-E3E3E3)\n\n\n## Deploy da aplicação\n\n\n### Clonando o repositório\n\n```bash\ngit clone https://github.com/Renatoelho/Funcoes-SQL-UDF-Python.git Funcoes-SQL-UDF-Python\n```\n\n\n### Preparando o ambiente\n\n+ Acessando o diretório clonado\n```bash\ncd Funcoes-SQL-UDF-Python/\n```\n\n+ Criando o ambiente virtual\n```bash\npython3 -m venv .venv\n```\n\n+ Ativando o ambiente virtual\n```bash\nsource .venv/bin/activate\n```\n\n+ Instalando as dependências\n```bash\npip install -U pip setuptools wheel --no-cache-dir \u0026\u0026 pip install -r requirements.txt --no-cache-dir\n```\n\n+ Ativando o Jupyter Notebook\n```bash\njupyter notebook\n```\n\nAgora é só acessar o Notebook que será aberto em seu nevegador ou [http://localhost:8888/tree](http://localhost:8888/tree).\n\n\n# Referências\n\nJupyter Notebooks, **DuckDB.** Disponível em: \u003chttps://duckdb.org/docs/guides/python/jupyter\u003e. Acesso em: 27 jun. 2024.\n\nPython Function API, **DuckDB.** Disponível em: \u003chttps://duckdb.org/docs/api/python/function\u003e. Acesso em: 27 jun. 2024.\n\nConfiguration, **DuckDB.** Disponível em: \u003chttps://duckdb.org/docs/configuration/overview#examples\u003e. Acesso em: 27 jun. 2024.\n\nValidação de CNPJ - Python 3, **Github.** Disponível em: \u003chttps://github.com/Renatoelho/validacao-cnpj-python3\u003e. Acesso em: 27 jun. 2024.\n\nValidação de CPF - Python 3, **Github.** Disponível em: \u003chttps://github.com/Renatoelho/validacao-cpf-python3\u003e. Acesso em: 27 jun. 2024.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenatoelho%2Ffuncoes-sql-udf-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenatoelho%2Ffuncoes-sql-udf-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenatoelho%2Ffuncoes-sql-udf-python/lists"}