Skip to content

Commit

Permalink
people.yaml file created to add authors info
Browse files Browse the repository at this point in the history
  • Loading branch information
paul.marcombes committed Nov 6, 2024
1 parent b99783c commit c2dec44
Show file tree
Hide file tree
Showing 149 changed files with 285 additions and 587 deletions.
26 changes: 26 additions & 0 deletions bigfun/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from . import utils

TABLES_FOLDER = 'data'
PEOPLE_FILENAME = 'people.yaml'
THIS_FOLDER = os.path.dirname(os.path.realpath(__file__)).replace('\\', '/')
WEBSITE_CONFIG_FOLDER = THIS_FOLDER + '/website'
CATEGORIES_DOC_TEMPLATE_FILENAME = f'{THIS_FOLDER}/templates/categories.md'
Expand Down Expand Up @@ -44,6 +45,30 @@ def get_config_value(name, config_filename):

def generate_doc(project, dataset):

def get_people():
if not os.path.isfile(PEOPLE_FILENAME):
return {}
with open(PEOPLE_FILENAME, encoding='utf-8') as f:
people = yaml.safe_load(f.read())
return {
person['name']: person
for person in people
}

def enrich_bigfunctions_author(bigfunctions):
people = get_people()
for bigfunction in bigfunctions:
if 'author' not in bigfunction.config:
continue
author = bigfunction.config['author']
if isinstance(author, dict):
# backward compatibility
continue
if author in people:
bigfunction._config['author'] = people[author]
else:
bigfunction._config['author'] = {'name': author}

def init_docs_folder():
os.makedirs('docs', exist_ok=True)
shutil.rmtree('docs/bigfunctions', ignore_errors=True)
Expand Down Expand Up @@ -91,6 +116,7 @@ def generate_bigfunctions_list_markdown(bigfunctions):
bf.BigFunction(bigfunction_name, project=project, dataset=dataset)
for bigfunction_name in bf.list_bigfunctions()
]
enrich_bigfunctions_author(bigfunctions)
init_docs_folder()
copy_readme_and_contributing()
copy_default_site_config()
Expand Down
5 changes: 4 additions & 1 deletion bigfunctions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ BigFunctions are open-source BigQuery routines that give you **SQL-superpowers**
| `us-west2` | `bigfunctions.us_west2` |
| `us-west3` | `bigfunctions.us_west3` |
| `us-west4` | `bigfunctions.us_west4` |




Expand All @@ -77,6 +77,7 @@ BigFunctions are open-source BigQuery routines that give you **SQL-superpowers**
- [<code>ask_ai(prompt, model)</code>](ask_ai.md): Ask Anything!
- [<code>ask_appstore_reviews(prompt, app_url_in_appstore)</code>](ask_appstore_reviews.md): Ask AI what your app users think.
- [<code>ask_my_data(question, fully_qualified_table)</code>](ask_my_data.md): Ask your data any `question` in natural language.
- [<code>categorize(items)</code>](categorize.md): Categorize `items` in categories and subcategories.
- [<code>classify_text(text, candidate_labels)</code>](classify_text.md): Classify `text` among `candidate_labels`
- [<code>generate_categories(items)</code>](generate_categories.md): Return `categories` of `items`.
- [<code>generate_face_embedding(image_url)</code>](generate_face_embedding.md): Detect Face on image and Generate its Embedding
Expand Down Expand Up @@ -270,3 +271,5 @@ BigFunctions are open-source BigQuery routines that give you **SQL-superpowers**
- [<code>timestamp_from_unix_date_time(unix_date_time, date_time_part)</code>](timestamp_from_unix_date_time.md): Interprets `unix_date_time` as the number of `date_time_part` since `1970-01-01 00:00:00 UTC`.
- [<code>timestamp_to_unix_date_time(timestamp_expression, date_time_part)</code>](timestamp_to_unix_date_time.md): Returns the number of `date_time_part` since `1970-01-01 00:00:00 UTC`.
- [<code>upsert(query_or_table_or_view, destination_table, insertion_mode, primary_keys, recency_field)</code>](upsert.md): Merges `query_or_table_or_view` into the `destination_table`.


5 changes: 1 addition & 4 deletions bigfunctions/are_arrays_equal.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_sql
category: transform_array
author:
name: Sid Ali
url: https://www.linkedin.com/company/esmoz/
avatar_url: "https://esmoz.fr/wp-content/uploads/2022/03/logo_esmoz_40x20-1.png"
author: Sid Ali
description: |
Return true if `array1` = `array2`
and false otherwise
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/array_intersect.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_sql
category: transform_array
author:
name: Axel Thevenot
url: https://www.linkedin.com/in/axel-thevenot/
avatar_url: "https://avatars.githubusercontent.com/u/39374103?v=4"
author: Axel Thevenot
description: |
Returns the intersection of two arrays.
arguments:
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/array_union.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_sql
category: transform_array
author:
name: Axel Thevenot
url: https://www.linkedin.com/in/axel-thevenot/
avatar_url: "https://avatars.githubusercontent.com/u/39374103?v=4"
author: Axel Thevenot
description: |
Returns the union of two arrays.
arguments:
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/ask_ai.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_py
category: AI
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a/ACg8ocIAw-jJTmt7AkDhU6_OvDQwsy9uyuRiWX8MxUBOdpro8lRJEgk5=s288-c-no"
author: Paul Marcombes
description: |
Ask Anything!
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/ask_appstore_reviews.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_sql
category: AI
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a/ACg8ocIAw-jJTmt7AkDhU6_OvDQwsy9uyuRiWX8MxUBOdpro8lRJEgk5=s288-c-no"
author: Paul Marcombes
description: |
Ask AI what your app users think.
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/ask_my_data.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: procedure
category: AI
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a/ACg8ocIAw-jJTmt7AkDhU6_OvDQwsy9uyuRiWX8MxUBOdpro8lRJEgk5=s288-c-no"
author: Paul Marcombes
description: |
Ask your data any `question` in natural language.
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/benford_distance.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_sql
category: transform_array
author:
name: Thomas F McGeehan V
url: https://www.linkedin.com/in/tfmv5
avatar_url: "https://avatars.githubusercontent.com/u/3191913?s=60&v=4"
author: Thomas F McGeehan V
description: |
Calculate the distance from Benford's Law for given `values`.
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/camel2snake.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_sql
category: transform_string
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a/ACg8ocIAw-jJTmt7AkDhU6_OvDQwsy9uyuRiWX8MxUBOdpro8lRJEgk5=s288-c-no"
author: Paul Marcombes
description: Convert `string` from camelCase to snake_case
arguments:
- name: camelCaseString
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/categorize.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_py
category: AI
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a/ACg8ocIAw-jJTmt7AkDhU6_OvDQwsy9uyuRiWX8MxUBOdpro8lRJEgk5=s288-c-no"
author: Paul Marcombes
description: |
Categorize `items` in categories and subcategories.
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_sql
category: explore
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a-/ACB-R5RDf2yxcw1p_IYLCKmiUIScreatDdhG8B83om6Ohw=s260"
author: Paul Marcombes
description: |-
Return html with a chartjs chart
arguments:
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/classify_text.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_py
category: AI
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a/ACg8ocIAw-jJTmt7AkDhU6_OvDQwsy9uyuRiWX8MxUBOdpro8lRJEgk5=s288-c-no"
author: Paul Marcombes
description: |
Classify `text` among `candidate_labels`
using [zero-shot classification](https://huggingface.co/tasks/zero-shot-classification)
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/connected_components.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: procedure
category: graph
author:
name: Furcy Pin
url: https://www.linkedin.com/in/furcy-pin-3790b028/
avatar_url: "https://media.licdn.com/dms/image/C4D03AQFK5YDJyod_3A/profile-displayphoto-shrink_200_200/0/1590431668428?e=1677110400&v=beta&t=_DHEt_NWaU5CIIC2UyYdK3gHj7KKUjzH9DTVhZcEmOY"
author: Furcy Pin
description: |
Compute the connected components of a non-directed graph.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_sql
category: transform_string
author:
name: "Benjamin Tabet"
url: https://www.linkedin.com/in/benjamin-tabet
avatar_url: "https://taskfilescsm.s3.amazonaws.com/uploads/speaker_thumb/2022-11-0912%253A07%253A34879766-BenjaminTabet.jpg"
author: "Benjamin Tabet"
description: "Replace all non ASCII characters with escape unicode"
arguments:
- name: text
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: procedure
category: transform_json
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a/ACg8ocIAw-jJTmt7AkDhU6_OvDQwsy9uyuRiWX8MxUBOdpro8lRJEgk5=s288-c-no"
author: Paul Marcombes
description: |
Create a Materialized view of a table with `json_column` flattened
.
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/date_sub_isoyear.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_sql
category: transform_date
author:
name: Stephane KNOCKAERT
url: "https://www.linkedin.com/in/knockaertstephane/"
avatar_url: "https://media.licdn.com/dms/image/C4E03AQGAa5CX20cU5g/profile-displayphoto-shrink_200_200/0/1651827360843?e=1691020800&v=beta&t=0M3BkmD7Nc6EiGv7ZHtRQb6HFn-USSvkK_WSnSIAB6k"
author: Stephane KNOCKAERT
description: |
Returns same day `years` before
(same week number and same day of week)
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/deduplicate_rows.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: procedure
category: utils
author:
name: Shivam Singh
url: https://www.linkedin.com/in/shivamsingh012/
avatar_url: "https://media.licdn.com/dms/image/D4D03AQERv0qwECH0DA/profile-displayphoto-shrink_200_200/0/1675233460732?e=1686182400&v=beta&t=HqngiSx5zd4llZStwf3L0k2T_pE8qvnEj7NguWNJTOo"
author: Shivam Singh
description: Returns the deduplicated rows of `query_or_table_or_view`
arguments:
- name: query_or_table_or_view
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/deidentify.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_py
category: transform_string
author:
name: Shivam Singh
url: https://www.linkedin.com/in/shivamsingh012/
avatar_url: "https://media.licdn.com/dms/image/D4D03AQERv0qwECH0DA/profile-displayphoto-shrink_200_200/0/1675233460732?e=1686182400&v=beta&t=HqngiSx5zd4llZStwf3L0k2T_pE8qvnEj7NguWNJTOo"
author: Shivam Singh
description: |
Masks sensitive information of type `info_types` in `text`
using [Cloud Data Loss Prevention](https://cloud.google.com/dlp)
Expand Down
4 changes: 1 addition & 3 deletions bigfunctions/detect_anomalies.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
type: function_py
category: detect_anomalies
author:
name: Thomas F McGeehan V
url: https://www.linkedin.com/in/tfmv5
author: Thomas F McGeehan V
description: |
Detect anomalies in time-series data to identify outliers and unusual patterns.
This function uses Z-score to find anomalies in the specified column of a BigQuery table.
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/detect_sensitive_info.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_py
category: transform_string
author:
name: Shivam Singh
url: https://www.linkedin.com/in/shivamsingh012/
avatar_url: "https://media.licdn.com/dms/image/D4D03AQERv0qwECH0DA/profile-displayphoto-shrink_200_200/0/1675233460732?e=1686182400&v=beta&t=HqngiSx5zd4llZStwf3L0k2T_pE8qvnEj7NguWNJTOo"
author: Shivam Singh
description: |
Detect sensitive information in `text`
using [Cloud Data Loss Prevention](https://cloud.google.com/dlp)
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/distinct_values.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_sql
category: transform_array
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a/ACg8ocIAw-jJTmt7AkDhU6_OvDQwsy9uyuRiWX8MxUBOdpro8lRJEgk5=s288-c-no"
author: Paul Marcombes
description: Return distinct values
arguments:
- name: arr
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/exchange_rate.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_py
category: get_data
author:
name: Johan PROTIN
url: https://www.linkedin.com/in/johan-protin
avatar_url: "https://avatars.githubusercontent.com/u/16030047?v=4"
author: Johan PROTIN
description: |
Get `exchange_rate`
from `base` (e.g. `USD`) to `to` (e.g. `EUR`)
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/explore_column.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: procedure
category: explore
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a/ACg8ocIAw-jJTmt7AkDhU6_OvDQwsy9uyuRiWX8MxUBOdpro8lRJEgk5=s288-c-no"
author: Paul Marcombes
description: Show column statistics
arguments:
- name: fully_qualified_column
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/explore_dataset.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: procedure
category: explore
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a/ACg8ocIAw-jJTmt7AkDhU6_OvDQwsy9uyuRiWX8MxUBOdpro8lRJEgk5=s288-c-no"
author: Paul Marcombes
description: |-
Show infos about dataset tables
arguments:
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/explore_events.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: procedure
category: wip
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a/ACg8ocIAw-jJTmt7AkDhU6_OvDQwsy9uyuRiWX8MxUBOdpro8lRJEgk5=s288-c-no"
author: Paul Marcombes
description: Show events (WORK IN PROGRESS)
arguments:
- name: events_table
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/explore_funnels.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: procedure
category: wip
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a/ACg8ocIAw-jJTmt7AkDhU6_OvDQwsy9uyuRiWX8MxUBOdpro8lRJEgk5=s288-c-no"
author: Paul Marcombes
description: Show funnels (WORK IN PROGRESS)
arguments:
- name: events_table
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/explore_table.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: procedure
category: explore
author:
name: Paul Marcombes
url: https://www.linkedin.com/in/paul-marcombes
avatar_url: "https://lh3.googleusercontent.com/a/ACg8ocIAw-jJTmt7AkDhU6_OvDQwsy9uyuRiWX8MxUBOdpro8lRJEgk5=s288-c-no"
author: Paul Marcombes
description: Show table infos and column statistics
arguments:
- name: fully_qualified_table
Expand Down
7 changes: 2 additions & 5 deletions bigfunctions/export_to_datastore.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_py
category: export
author:
name: El-Walid
url: https://www.linkedin.com/in/el-walid/
avatar_url: https://media.licdn.com/dms/image/C4E03AQH6oIAxScy4gw/profile-displayphoto-shrink_800_800/0/1654708759415?e=1691625600&v=beta&t=U6Tgwl4JWamN4qYDJP2b498aJt5thWog84-qnbkz0bU
author: El-Walid
description: |
Exports `data` to Datastore
(Firestore in Datastore mode).
Expand Down Expand Up @@ -86,4 +83,4 @@ cloud_run:
concurrency: 16
max_instances: 10
quotas:
max_rows_per_user_per_day: 1000000
max_rows_per_user_per_day: 1000000
5 changes: 1 addition & 4 deletions bigfunctions/export_to_pubsub.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_py
category: export
author:
name: Valentin Cordonnier
url: https://www.linkedin.com/in/valentin-cordonnier-99482b1b5
avatar_url: "https://storage.googleapis.com/public-bucket-val/photo-output__01.jpg"
author: Valentin Cordonnier
description: |
Exports `data` and `attributes` to Pub/Sub `topic`.
Expand Down
5 changes: 1 addition & 4 deletions bigfunctions/faker.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
type: function_py
category: get_data
author:
name: Shivam Singh
url: https://www.linkedin.com/in/shivamsingh012/
avatar_url: "https://media.licdn.com/dms/image/D4D03AQERv0qwECH0DA/profile-displayphoto-shrink_200_200/0/1675233460732?e=1686182400&v=beta&t=HqngiSx5zd4llZStwf3L0k2T_pE8qvnEj7NguWNJTOo"
author: Shivam Singh
description: |
Generates fake data
of type `what` and localized with `locale` parameter (using [faker python library](https://faker.readthedocs.io/))
Expand Down
Loading

0 comments on commit c2dec44

Please sign in to comment.