Hướng dẫn nested lookup in excel - tra cứu lồng nhau trong excel

Làm việc với các phản hồi tài liệu của JSON, YAML và XML trở lại vui vẻ!

Gói Nested_Lookup cung cấp nhiều chức năng Python để làm việc với các tài liệu được lồng sâu. Một tài liệu trong trường hợp này là một hỗn hợp của từ điển Python và các đối tượng liệt kê thường xuất phát từ YAML hoặc JSON.

nested_lookup:

Thực hiện tra cứu khóa trên một tài liệu lồng nhau sâu. Trả về một danh sách các giá trị phù hợp.list of matching values.list of matching values.

nested_update:

Cho một tài liệu, tìm tất cả các sự cố của khóa đã cho và cập nhật giá trị. Theo mặc định, trả về một bản sao của tài liệu. Để biến đổi bản gốc Chỉ định đối số in_place = true.in_place=True argument.in_place=True argument.

nested_delete:

Cho một tài liệu, tìm tất cả các lần xuất hiện của khóa đã cho và xóa nó. Theo mặc định, trả về một bản sao của tài liệu. Để biến đổi bản gốc Chỉ định đối số in_place = true.in_place=True argument.in_place=True argument.

nested_alter:

Đưa ra một tài liệu, tìm tất cả các lần xuất hiện của khóa đã cho và thay đổi nó với chức năng gọi lại. Theo mặc định, trả về một bản sao của tài liệu. Để biến đổi bản gốc Chỉ định đối số in_place = true.in_place=True argument.in_place=True argument.

get_all_keys:

Tìm nạp tất cả các phím từ một từ điển được lồng sâu. Trả về một danh sách các khóa.list of keys.list of keys.

get_occurrence_of_key/get_occurrence_of_value:

Trả về số lần xuất hiện của khóa/giá trị từ một từ điển lồng nhau.

Để biết ví dụ về cách gọi các chức năng này, vui lòng kiểm tra các phần hướng dẫn.

Nội dung

  • Tải về

  • hướng dẫn nhanh chóng

  • Hướng dẫn dài hơn

  • Nested_alter hướng dẫn

  • Misc

Tải về

hướng dẫn nhanh chóng

pip install nested-lookup

Hướng dẫn dài hơn

git clone ssh://:2222/python/nested-lookup.git
cd nested-lookup
pip install .

hướng dẫn nhanh chóng

Hướng dẫn dài hơn

Nested_alter hướng dẫn

Misc

Cài đặt từ PYPI bằng PIP:nested_lookup:nested_lookup:

>>> from nested_lookup import nested_lookup
>>> print(nested_lookup('taco', document))
[42, 69]

hoặc cài đặt từ nguồn bằng cách sử dụng:

Hướng dẫn này sử dụng vỏ tương tác Python, vui lòng theo dõi :)nested_update:nested_update:

>>> from nested_lookup import nested_update
>>> nested_update(document, key='burrito', value='test')
[{'taco': 42}, {'salsa': [{'burrito': 'test'}]}]

Trước khi chúng tôi bắt đầu, hãy để xác định một tài liệu ví dụ để làm việc.burrito had it’s value changed to the string 'test', like we asked.burrito had it’s value changed to the string 'test', like we asked.

>>> document = [ { 'taco' : 42 } , { 'salsa' : [ { 'burrito' : { 'taco' : 69 } } ] } ]
nested_delete:
>>> from nested_lookup import nested_delete
>>> nested_delete(document, 'taco')
[{}, {'salsa': [{'burrito': {}}]}]
nested_delete:
>>> from nested_lookup import nested_delete
>>> nested_delete(document, 'taco')
[{}, {'salsa': [{'burrito': {}}]}]

Đầu tiên, chúng tôi tra cứu một khóa từ tất cả các lớp của tài liệu bằng Nested_Lookup:

Hướng dẫn dài hơn

Nested_alter hướng dẫn

Misc

Cài đặt từ PYPI bằng PIP:nested_lookup:

hoặc cài đặt từ nguồn bằng cách sử dụng:

Hướng dẫn này sử dụng vỏ tương tác Python, vui lòng theo dõi :)nested_update:

Trước khi chúng tôi bắt đầu, hãy để xác định một tài liệu ví dụ để làm việc.burrito had it’s value changed to the string 'test', like we asked.

Đầu tiên, chúng tôi tra cứu một khóa từ tất cả các lớp của tài liệu bằng Nested_Lookup:wild and find all the email addresses like this:
results = nested_lookup(
    key = "mail",
    document = my_document,
    wild = True
)

print(results)
["", "", "", ""]

Đầu tiên, chúng tôi tra cứu một khóa từ tất cả các lớp của tài liệu bằng Nested_Lookup:

git clone ssh://:2222/python/nested-lookup.git
cd nested-lookup
pip install .
0
git clone ssh://:2222/python/nested-lookup.git
cd nested-lookup
pip install .
0

Cài đặt từ PYPI bằng PIP:

Hướng dẫn này sử dụng vỏ tương tác Python, vui lòng theo dõi :)

git clone ssh://:2222/python/nested-lookup.git
cd nested-lookup
pip install .
1

Trước khi chúng tôi bắt đầu, hãy để xác định một tài liệu ví dụ để làm việc.

git clone ssh://:2222/python/nested-lookup.git
cd nested-lookup
pip install .
2
git clone ssh://:2222/python/nested-lookup.git
cd nested-lookup
pip install .
3

from nested_lookup import nested_lookup

my_document = {
   "name" : "Rocko Ballestrini",
   "email_address" : "",
   "other" : {
       "secondary_email" : "",
       "EMAIL_RECOVERY" : "",
       "email_address" : "",
    },
}
>>> document = [ { 'taco' : 42 } , { 'salsa' : [ { 'burrito' : { 'taco' : 69 } } ] } ]
wild and find all the email addresses like this:
results = nested_lookup(
    key = "mail",
    document = my_document,
    wild = True
)

print(results)
["", "", "", ""]

git clone ssh://:2222/python/nested-lookup.git
cd nested-lookup
pip install .
4

Như bạn có thể thấy hàm được trả về danh sách hai số nguyên, các số nguyên này là các giá trị từ các tra cứu khóa phù hợp.

git clone ssh://:2222/python/nested-lookup.git
cd nested-lookup
pip install .
5

Nested_alter hướng dẫn

Misc

Nested_alter hướng dẫn

Misc

Cài đặt từ PYPI bằng PIP:nested_lookup:

git clone ssh://:2222/python/nested-lookup.git
cd nested-lookup
pip install .
8

Misc

license:::
  • Cài đặt từ PYPI bằng PIP:nested_lookup:

authors:::
  • hoặc cài đặt từ nguồn bằng cách sử dụng:

  • Hướng dẫn này sử dụng vỏ tương tác Python, vui lòng theo dõi :)nested_update:

  • Trước khi chúng tôi bắt đầu, hãy để xác định một tài liệu ví dụ để làm việc.burrito had it’s value changed to the string 'test', like we asked.

  • >>> document = [ { 'taco' : 42 } , { 'salsa' : [ { 'burrito' : { 'taco' : 69 } } ] } ]
  • Đầu tiên, chúng tôi tra cứu một khóa từ tất cả các lớp của tài liệu bằng Nested_Lookup:

web:::
  • https://russell.ballestrini.net

  • Cài đặt từ PYPI bằng PIP:

  • https://github.com/Salfiii

  • https://github.com/matheuslins